Timeout problem, please help - Stored procedure.sql [0/1]
[This followup was posted to microsoft.public.dotnet.framework.adonet and a copy was sent to the cited author.]
Hello everybody.
I have a problem with ADO.NET when I try to connect to a SQL server
database.
My C# code call a stored procedure that is used to normalize a database
in which there are a lot of mistakes (some record are lower case but
some other are upper case etc).
The stored procedure works fine in SQL analyzer, but when I try to use
it in C# I have a timeout error.
In effect when I run the procedure using osql I must wait 5 minutes to
complete the operation(there are a lot of record inside the table that I
must normalize) but I don't know what I must do to work with my stored
procedure in C#. I tried to set connection timeout=600 but after 2
minutes the C# program stops and I have a SqlException
I don't know what to do, do you have some idea?
The server is correctly connected, it responds to my instructions
(
Console.WriteLine(mySqlConnection.WorkstationId);
Console.WriteLine(mySqlConnection.ConnectionString);
)
The attachments are the stored procedure and the C# code that I use,
thanks in advance to everybody.
PS the stored procedure isn't the original (that's complicated) but only
a "toy" that however block my application!
I know in advance that this it an idiot problem, but I did't arrive to
resolve it!
PPS the table reparto used by the stored procedure is composed by 328128
record Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79107
Getting last Insert ID
Hi,
I'm using a Access database with a dot.net application. To get last insert
Id(Autogenerated) from a specific tabel, I have used
"Select Max(Id) from table" to populate a datareader. I then use
"Reader.getint32" to get the id. This works fine when there is something in
the tabel. But when the table is empty I get a cast error, obviusly since
the Getint32 returns nothing. Is there a better way to get Last insert Id
from a Access database ?
TNX
Totto Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79104
OleDBConnection problem if database sesison is killed or database is restarted
Dear All,
We are facing problem for OleDBConnection if my connection to database
is killed or database server is restarted.
it gives error:
System.Data.OleDb.OleDbException: Session closed/terminated
Problem:
1. For executing SQL query we create new OleDBConnection, execute
that query and then instead of closing that connection,
we put that connection object in static arrayList
(freeConnectionList).
2. For next SQL query, it checks in that static arraylist for free
connection, if it gets any free connection, then uses that
connection object for executing query, else if it cannot find any
free connection in this arraylist, it creates new connection,
executes query and then add that connection in arraylist.
3. It works fine. But problem comes if my database session is killed
OR database is re-started.
4. if my database session is killed OR database is re-start, and I try
to fire query using connection object that is
there in static arraylist or using new OleDBConnection object, then
it generates error.
So if my database session is killed or database is restarted, then
1. I cannot use connection objects from static arraylist
2. and if I create new Connection object, then that new connection
object also fails to fire query.
Solution:
1. If my dadatabse session is killed or database is restarted, and I
try to fire a query, then it throws OleDBException, We will catch that
exception,
then then we will close all the connection from arraylist. For
this the code will be like this:
Pseudo Code:
public void ResetPool()
{
OleDBConnection dummyConnection = new OleDBConnection(connString);
// declare a dummy connection
dummyConnection.Open(); // open dummy connection
int i = freeConnectionList.Count-1;
while ( i >= 0 )
{
freeConnectionList[i].Close(); // close connection
i--;
}
dummyConnection.Close(); // close dummy connection
}
For this I have to create a dummy connection, open that connection and
then close that connection at the end when all connections from
arraylist are closed.
If I do these changes then it works fine.
Query:
Is this a correct method to handle situaton like database restart or
database session killed? OR there is any alternative way of doing the
same?
Thanx and Regards
Jack Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79102
Q: OleDbCommand Select Statement
Hi,
I have a OleDbCommand select statement as [string sqlStatement = "SELECT *
FROM Contact WHERE Department LIKE '*" + strSearch + "*' ORDER BY
Contact.ContactId;";], which retrieve data from MS Access database. The
statement always return 0 record. But if I take out the two "*"s, then it
will return those correct records. I tested the sql statement with the two
"*"s in MS Access itself, and it work fine by returning correct records. I
don't understand why it won't work when it is in my web service.
Please help.
Thank you.
--
Soul Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79096
TURN $12 INTO $12,000 NOW!!!
PEEP THIS SHIT YALL MY FRIEND GOT $500 LAST WEEK TRYING THIS SHIT:
make extra cash
GREAT WAY TO BECOME RICH...INSTANT THOUSANDS This is no scam, read
it!!!!!!
------------------------------------------------------------------------
-------- HOW TO TURN $12 INTO $12,000!!!!!!!!!!!!!!!!!!!!!!!!!!!! THIS
REALLY CAN MAKE YOU EASY MONEY!! IT WORKS !!! BUT YOU HAVE TO FOLLOW IT
TO THE LETTER FOR IT TO WORK!!!! : A little while back, I was browsing
through newsgroup, just like you are now and came across an article
similar to this that said you could make thousands dollars within weeks
with only an initial investment of $12.00! So I thought, "Yeah, right,
this must be a scam", but like most of us, I was curious, so I kept
reading. : Anyway, it said that you send $2.00 to each of the 6 names
and address stated in the article. You then place your own name and
address in the bottom of the list at #6, and post the article in at
least 200 newsgroup. (There are thousands) No catch, that was it. So
after thinking it over, and talking to few people first, I thought about
trying it. I figured what have I got to lose except 6 stamps and $12.00,
right? Like most of us I was a little skeptical and a little worried
about the legal aspects of it : All, So I checked it out with the U.S.
Post Office (1-800-725-2161) and they confirmed that it is indeed legal!
Then I invested the measly $12.00. Well GUESS WHAT!!?. Within 7 days, I
started getting money in the mail! I was shocked! I figured it would end
soon, but the money just kept coming in. In my first week, I made about
$25.00. By the end second week I had made a total over $1,000.00! In the
third week I had over $10,000.00 and it's still growing. This is now my
fourth week and I have made a total of just over $42,000.00 and it's
still coming in rapidly. Its : Certainly worth $12.00, and 6 stamps, I
have spent more than that on the lottery!! : Let me tell you how this
works and most importantly, why it works?.also, make sure you print a
copy of this article NOW, so you can get the information off of it as
you need it. STEP 1: Get 6 separate pieces of paper and write the
following on each piece of paper "PLEASE PUT ME ON YOUR MAILING LIST."
Now get 2 US $1.00 bills and place TWO inside EACH of the 6 pieces of
paper so the bills will not be seen through the envelope to prevent
thievery. Next, place one paper in each stating the above phrase, your
name and address, and 2 $1.00 bills. What you are doing is creating a
service by this. THIS IS ABSOLUTELY LEGAL! Mail the 6 envelopes to the
following addresses:
#1) Corteney Tomson P.O. Box 55 Dupo, IL 62239
#2) Brad Taylor 6 Terry Ln. Hutchinson, KS 67501
#3) Cedric Etienne 239 Autumn Breeze Way Winter Park, FL 32792
#4) Stephen Mitchell 1977 Alcovy Trace Way Lawrenceville, GA 30045
#5) Melissa Martinez 15440 sw 74 cir ct #607 Miami, FL 33193
#6) Maurice Sawyers 49 Middle Rose St Trenton, NJ 08618
STEP 2: Now take the #1 name off the list that you see above, move the
other names up (6 becomes 5, 5 becomes 4, etc?.) and add YOUR Name as
number 6 on the list. STEP 3: Change anything you need to, but try to
keep this article as close to original as possible. Now, post your
amended article to at least 200 newsgroups, message board. (I think
there are close to 24,000 groups) All you need is 200, but remember, the
more you post, the more money you make!---- DIRECTIONS----HOW TO POST TO
NEWSGROUPS, MESSAGE BOARD----------Step 1) You do not need to re-type
this entire letter to do your own posting. Simply put your cursor at the
beginning of this letter and drag your : Cursor to the bottom of this
document, and select 'copy' from the edit menu. This will copy the
entire letter into the computer memory. Step 2) Open a blank 'notepad'
file and place your cursor at the top of the blank page. From the
'edit' menu select 'paste'. This will paste a copy of the letter into
notepad so that you can add your name to the list. Step 3) save your new
notepad file as a .txt file. If you want to do your postings in
different sittings, you'll always have this file to go back to. : Step
4) Use Netscape or Internet explorer and try searching for various
newsgroups (on-line forums, message boards, chat sites, discussions.)
Just example you log on any search engine like yahoo. com,google.
com,altavista. com,excite. com then you search with this subject ?
millionaire message board? or ?money making message board? or ?
employment message board? or ?money making discussions? or ?money making
forum? or ?business message board? etc. You will find thousand &
thousand message board. Click one by one then you will find the option
post a new message. : Step 5) Visit these message boards and post this
article as a new message by highlighting the text of this letter and
selecting paste from the edit menu. Fill in the Subject, this will be
the header that everyone sees as they scroll through the list of
postings in a particular group, click the post message button. You're
done with your first one!. : Congratulations? THAT'S IT! All you have to
do is jump to different newsgroups and post away, after you get the hang
of it, and it will take about 30 seconds for each newsgroup! **
REMEMBER, THE MORE NEWSGROUPS OR MESSAGE BOARD YOU POST IN, THE MORE
MONEY YOU EILL MAKE!! BUT YOU HAVE TO POST A MINIMUM OF 200** That's it!
You will begin receiving money from around the world within days! You
may eventually can rent a P.O. Box due to the large amount of mail you
will receive. If you wish to stay anonymous, you can invent a name to
use, as long as the postman will deliver it. **JUST MAKE SURE ALL THE
ADDRESSES ARE CORRECT. ** : Now the WHY part: Out of 200 postings, say I
receive only 5 replies (a very low example). So then I Made $5.00 with
my name at #6 on the letter. Now, each of the 5 persons who just sent me
$1.00 make the MINIMUM 200 postings, each with my name at #5 and only 5
persons respond to each of the original 5, that is another $25.00 for
me, now those 25 each make 200 MINIMUM posts with my name at #4 and only
5 replies each, I will bring in an additional :$125.00! Now, those 125
persons turn around and post the MINIMUM 200 with my name at #3 and only
receive 5 replies each, I will make an additional $625.00! OK, now here
is the fun part, each of those 625 persons post a MINIMUM 200 letters
with my name at #2 and they only receive 5 replies, that just made me
$3,125.00!!! Those 3,125 persons will all deliver this message to 200
newsgroups with my name at #1 and if still 5 persons per 200 newsgroups
react I will receive $15,625.00! With an original investment of only
$12.00! AMAZING! When your name is no longer on the list, you just take
latest posting in the newsgroups, and send out another $12.00 to names
on the list, putting your name at number 6 again. And start posting
again. The thing to remember is, do you realize that thousands of people
all over the world are joining the internet and reading these articles
everyday, JUST LIKE YOU are now!! So can you afford $12.. and see if it
really works?? I think so? People have said, 'what if the plan is played
out and no one sends you: the money? So what are the chances of that
happening when there are tons of new honest users and new honest people
who are joining the internet and newsgroups everyday and are willing to
give it a try? Estimates are at 20,000 to 50,000 new users, every day,
with thousands of those joining the actual Internet.
AND YES YOU HAVE TO SEND THE MONEY FOR THIS TO WORK!!!dont try not to,IT
WONT WORK TRUST ME Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79089
ANN- Object Relation Modelling Forum Opened at Devbuzz
www.devbuzz.com just opened up a forum for discussion of Object Relational
Modelling tools which allow you to seperate your business logic from data
access. If you're interested in learning more about ORM (which is pretty
darned cool if you do a lot of data access work), please join us...
http://forums.devbuzz.com/tm.asp?m=28744&appid=&p=1&mpage=1&key=&tmode=1&smode=1&s=#28790
For general info on ORM.. check this out..
http://www.15seconds.com/issue/040112.htm
--
Cordially,
W.G. Ryan MVP
Windows - Embedded
dotnetguru@comcast.nospam.net
www.devbuzz.com
www.knowdotnet.com Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79083
DataView
Hello
I am editing serveral textboxes that are bound to a DataView, But I don't know how to updatd my Tables with the changed information
thanks for helping me. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79081
Connection is busy with results for another command
After migrating an existing app from VB6 to VB .Net, SQL operations on ADO
started giving this error periodically:
Connection is busy with results for another command
I am still using the ADODB library -- I did not migrate to ADO.Net
Looking at the SQL Server enterprise manager, I see that the .NET version
opens 4 database connections, while the VB6 version only opens one (both
programs were tested on the same computer with the same databases.)
Anyone have insights on why ADODB would launch multiple connections which
then collide with one another?
Thanks,
Lee Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79079
DAAB: hierarchical updates and deletes
I have a parent child relationship that I have having a hard time
either inserting and updating or deleting. I have a parent DataTable
(Contact) and a child DataTable (ContactPhone). I am using a
DataRelation between them. I am also using the MS Data Access
Application Blocks. I have read numerous forums on how to delete a
child record with changing the AcceptRejectRule to cascade. From what
I can understand this is done at the DataAdapter level. I also
understand that inserts and updates need to happen in a different
order than deletes with a relation.
What I am wondering is if and how I can implement a relation like this
using the MS DAAB. Has anyone been able to do this and if so how? I
thought about extending the SqlHelper.cs, but don't know if there is
success in doing that. Thought I would try it out here before
pounding my head even more with this issue.
Any help would be greatly appreciated and thank you in advance.
Thanks. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79078
Multiple-step OLE DB operation generated errors...
I am getting the following error message:
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
Below I will outline the scenario that generated, and would appreciate
help with this problem, but I have another question as well:
I have seen a great number of articles on google and in the .net help
regarding this error message and specific instances of how to make it
go away, but can someone tell me if you can get the actual individual
db error messages when this exception is thrown? I haven't seen
anything that talks about that. Is it possible?
Problem:
I am trying to connect to db2 on an AS/400 using the following code
executing with the parameter strProvider = "IBMDA400". I have been
adding parameters such as Transport Product and Persist Security Info
as I find little bits of info, with no luck.
*****************************************************************************
Private Function OleDBInit(ByVal strProvider As String) As Boolean
RaiseEvent Begin(templateObj.Exports.Count + 2)
RaiseEvent StepNext()
'Initialize and open the database connection
RaiseEvent StatusUpdate("Creating OLEDB object...")
RaiseEvent StepNext()
conOleDB = New OleDb.OleDbConnection
Select Case strProvider
Case "OraOLEDB.Oracle"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Data Source=" & strServerName &
";Provider=" & strProvider
Case "SQLOLEDB"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Initial Catalog=" & strDatabaseName &
";Data Source=" & strServerName & ";Provider=" & strProvider
Case "IBMDA400"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Initial Catalog=" & strDatabaseName &
";Data Source=" & strServerName & ";Provider=IBMDA400.Datasource.1" &
";Persist Security Info=True" & ";Transport Product=Client Access" &
";SSL=DEFAULT"
Case Else
OleDBInit = False
Exit Function
End Select
Try
RaiseEvent StatusUpdate("Opening OLEDB connection...")
RaiseEvent StepNext()
***************************
conOleDB.Open()
***************************
Catch eOleDB As Exception
RaiseEvent ErrorOccured(eOleDB.Source & " - " &
eOleDB.Message)
OleDBInit = False
Exit Function
End Try
RaiseEvent StatusUpdate("Connected to database.")
RaiseEvent StepNext()
OleDBInit = True
End Function
*****************************************************************************
The exception is thrown when the conOleDB.Open() statement is
executed.
Thanks,
John Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79076
When a connection closes....
WRT:
System.Data.SqlClient.SqlConnection
When an SqlConnection goes out of scope, is the .close() called by it's
destructor?
thanks. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79070
SQLDataAdapter.Update code fails, no errors. Any ideas?
I am having so much trouble updating this DB. I have the following code
in place and all is working well for the UpdatePerson code, but the
Update Activity fails with no error message, and no update to the DB.
I am trying to re-use the SqlUpdateCommand1 object and I think it is
failing because of that. I can see the UpdatePerson code in profiler,
but the UpdateActivity never seems to make it to SQL.
Can you see what the problem is?
Thanks
Aaron
Public Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Call UpdatePerson()
Call UpdateActivity()
End Sub
Public Sub UpdatePerson()
Dim pID As Integer = Me.GetSelectedPersonID(Me.DataGrid1,
DataSet11, "Searches_Activity")
If pID = 0 Then
Return
End If
Dim SqlUpdateCommand1 As New SqlClient.SqlCommand()
Me.SqlUpdateCommand1.CommandText = "UPDATE Person SET Name_Full =
'" & txtFullname.Text() & "', Title_Long = '" & txtTitle.Text() & "',
Phone = '" & txtphone.Text() & "', CellPhone = '" & txtAppCell.Text() &
"'," & _
"BPhone = '" & txtBPhone.Text() & "', Salary = '" &
txtAppSalary.Text() & "', TotalComp = '" & txtCompensation.Text() & "',
Resume = '" & txtResume.Text() & "', Bphone_Extension = '" &
txtWorkExt.Text() & "', Reg" & _
"ion_CD = '" & txtRegCode.Text() & "'"
Me.SqlUpdateCommand1.CommandText =
Me.SqlUpdateCommand1.CommandText & " where Person_ID = " & pID
SqlDataAdapter1.Update(DataSet11)
End Sub
Public Sub UpdateActivity()
Dim nID As Integer = Me.GetSelectedRecordID(Me.DataGrid1,
DataSet11, "Searches_Activity")
If nID = 0 Then
Return
End If
Dim SqlUpdateCommand1 As New SqlClient.SqlCommand()
Me.SqlUpdateCommand1.CommandText = "UPDATE Activity SET FollowUp
= '" & txtFollowUpDate.Text() & "'"
Me.SqlUpdateCommand1.CommandText =
Me.SqlUpdateCommand1.CommandText & " where Activity_ID = " & nID
Try
SqlDataAdapter1.Update(DataSet11)
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex.GetBaseException
().Message())
End Try
End Sub Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79069
SqlDataAdapter.Update()
I read some records from a text file using OleDbDataAdapter into a DataTable. Now I'd like to upload these records to Sql Server using SqlDataAdapter. Currently, I clone my DataTable and insert records into my cloned DataTable. This way the SqlDataAdapter properly recognizes that the records are new. Does anyone have an alternative technique
Thanks
Paul Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79067
DataSet / DataTable / Row selection
Hi,
Does someone could tell me an easy way to select the last row added in a
DataTable inside a DataSet ?
Something like :
DataSet.Table(myTable).SelectLastRowAdded ()
Thank you. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79064
UTF 8 Encoding in ADO.NET
Hello
we are into internationzation our App. we are facing one issue : right now, VB.NET is communicating to the ODBC driver (Teradata) in utf16 encoding. but the odbc driver can handle only utf-8 encdoing , not the utf-16. we tried to use th
utf-8 encoding function to convert the utf8 to utf16 which is not useful in this case because it stores the data in byte array.
Is there is any specificed functions through i can set the Globally the Odbbc communcation to UTF8? please let me if you anybody has faced this issue or anyworkaround
thanks
paul Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79063
Identifying a newly created row ?
Hi
I have a DataGrid bound to a DataView, and when adding a new row to the view I want it to be the current/selected one
I've tried the followerin
DataRowView row = myView.AddRow()
row["Date"] = DateTime.Today Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79061
SQLConnection Object Please HELP???
I have declared a property as a SQLConnection Object.
In this implementation this property is being used in a class which is
derived from a Web Control Base Class.
My Class once built exposes properies in the designer.
It exposes the SQLConnection Property as well.
The problem is that when I use the designer to build a connectionstring for
the porperty it doesn't pass it thru to the control in run time the
connectionstring property comes back null meaning not initialized.
The property was implemented in the standard.
Dim object as new Object
Property as Object
get
return Object
end get
set
Object = value
end set
etc...
Any ideas on how to use this object as a property.
The SQLConnection class cannot be inherited from so
I am at a loss...
Thanks in Advance!
Chris... Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79058
Optimising app
Hi
We have an access application running over a win2k network. I have now
rewritten the ap in vb.net and the problem is that the vb.net app runs
generally slower(!) then than the access app.
I am using a typical dataset/dataadapter scenario and doing most of the
things in code including the data access layer and individual field binding.
I am reading one master record at a time so this should not be too slow(?).
The detail records appear in grids but these are indexed retrieval.
How can I optimise the application? What areas can I look into and what
techniques can I use to pinpoint the bottlenecks?
Thanks
Regards Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79056
Can someone educate me?
I have been building a windows app with a sql query, but I was using a
view and I learned that it is very difficult to use a view for updates.
So I began investigating this and found some information regarding
creating multiple sqldataadapters, one for each table, and then
generating a dataset to include all of the tables (sqldataadapters).
The information was found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/vbcon/html/vbwlkwalkthroughcreatingmaster-detailwindowsform.asp
I have then edited the resulting XSD document and added realtionships and
keys, in an attempt to replicate the relationships that exist in my SQL
view.
So I have a few questions about how to proceed selecting and updating the
data.
Now that I have multiple dataadapters, and each one has it's own
select/insert/update/delete commands, and I had previously selected from
a view which contained all of the necessary columns, how do I select
these multiple columns from multiple tables and maintain the
relationships?
Which DataAdapter do I use for the select?
When I do the .fill, which dataadapter should I use?
How do I get the selected columns to appear in my datagrid?
Why does my datagrid have a plus sign in the row header and all of the
key relationships as links?
Is there any material that covers these questions? I have been unable to
find many relavent articles.
If there is a way of updating a view, please let me know how, I may be
able to salvage the original application.
Thanks for your time.
Aaron Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79052
DataAdapter.Update Problem
hi all,
I'm building a typed dataset from a sql table. Later programmatically inserting rows upon user data. When I execute DataAdapter.Update(ds). I get a constraint violation on one of the columns which is non-null column. Looking at the XML data in the dataset, I get an exception on a row that is not there in the table rather a row that should be next in the sequence.
For example If I insert 3 rows in the table in the dataset. Then i get error xyz column does not allow NULL data, insert fails. Can anybody guide me thru this problem.
Thanks in advance.
-HKM Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79051
Detect changes to record in SQL Server CE
I'd like to find an easy way to find out if a record in SSCE was changed by
the user in my VB .NET app.
I'm thinking of filling a DataSet object with the original record, show the
record to the user for editing, and then after the user is done, filling
another DataSet object with the record from the DB and looping through the
columns in the 2 DataSets to see if anything has changed.
It would be cool if you could do a DataSet.CompareToDB to find out if the
DataSet you have is still the same as in the underlying database.
Does anyone know a better way to do this? Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79047
Concurrency Problem
Hello to all,
I have a problem between 2 programs I have running.
We have got an old databridge for our clients to upload data to our
central database. This one is written in C++ (not by me).
We now have a new Databridge developped, which is written in VB.NET.
Functionally they are the same, but technically there are differences.
I think we have got a concurrency problem, because when the new
Databridge (VB.Net) is running (several instances), the old databridge
will not run.
The error given by the old databridge, is that it cannot connect to
the database, while it can when NOT using the new databridge.
Some technical details:
Old Databridge:
- C++;
- using port 8041 (this one has a direct connection with the client);
New Databridge:
- VB.Net
All is running on a Win2K SBS SP3 with SQL Server 2000.
It is difficult for me to explain, so when more information is needed,
please ask me!!
Thanks to everyone in advance.
Kind Regards,
Marcel Groffen Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79040
Moving Data Between 2 Databases (SQL)
I have created a web form that enables a user to pass a large amount
of data between 2 different SQL 2000 Databases. The current
methodology is to extract the source data, store it in a .Net dataset
and then using the CmdBuilder, pass each line of data out to the
destination database.
I'm having some issues with the size (1000s of lines) and time of the
data transfer that invariably ends up with either a SQL timeout (I
have set all Command.Timeouts=0) or the aspnet_wp.exe process cycles
during inactivity. I have attempted to use SQLServer session state
management, but am not very familiar with exactly how that works
(authentication is also an issue here).
My question is, can I use a different method of moving the data from
the dataset to the database? I feel as though there must be a more
efficienct, less time consuming way. Is it possible to move an entire
dataset at once? Can SQL and .Net perform this?
Thanks in advance for your help.
Rob Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79035
Fill question
Does a Fill command make an automatic connection when initiated? When it is
through does it automatically disconnect?
I am just wondering if I need something like the following around a fill
command?
mySqlConnection = New SqlConnection(myConnectionString)
DaContracts.Fill(DsMain1, "Contracts")
mySqlConnection.Close() Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79034
Cancel a delete operation
Hi,
I am trying to cancel the deletion of a datarow. When the user presses the
Delete button, a messagebox displays asking the user if they really want to
delete the current row. If "Yes", then the delete occurs; if "No", then the
current row remains in the table and is not marked for deletion.
My problem is that if the user presses the "No" button on the messagebox the
row is still removed from the table (marked for deletion). How can I stop
that from happening using the above code description?
Here's my code:
******************************
With Me.BindingContext(dvCustomers) ' references a dataview object
Select Case CType(sender, Button).Name
'other case statements are omitted here; they work fine
Case "btnDelete"
MsgBox("Are you sure you want to delete the current row?", &
_
MsgBoxStyle.YesNo, "Delete Row")
If MsgBoxResult.Yes Then
.RemoveAt(.Position)
UpdatePosition() 'utility method
End If
If MsgBoxResult.No Then
.Position = .Position 'problem occurs here - need
help
End If
End Select
******************************
Thanks,
Roshawn Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79029
Filters with Dataview or new SELECT
I am new to database programming, and would like to follow the preferred
programming methods when possible...
I have large databases, in a small 'always connected' environment. I have
been pulling large tables, and creating filters with some checkboxes etc..,
which create dataviews. Couple of questions:
1. Is there an easier way to create the filters than a bunch of IF THEN's
to create the filter string? (ie: if first filter add "(", if last add
")", if not first or last add " or ")...
2. Can I use the Compute command on dataviews?
3. I have been creating some classes to help with the 'logic' of analysis
on some of the data. It appears to me that developers choose between
either using the DataAdapters, Datasets and bound data direct from the
database for their forms, or they create class objects, and bind the
classes to the datasources. It would appear that classes would be the
safest, but more complex route. The VB books that I have spend good energy
on classes, and then good energy on ADO, but always seem to separate ADO
from classes (ie: run through all the standard dataadapter/dataset bound
directly to the forms components). I am currently enjoying the Deitel
VB.NET book, which I highly recommend to beginning programmers - but it
will take me some time to get through it.
Looking forward to any comments.
Masa Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79024
Repeater Vs Datagrid
Hi All
For one page I want to implement sortng as well as paging. Curretly that page is using datagrid for data binding and sorting. Datagrid supports attributes like sortexpression and sort order to provide sorting very easily. is there any thing supported by repeater. Also for repeater I have one paging repeater class ready with me. So, i vcan simply derive a class from it and implement things
But, what i want to know is which one is better keeping into mind the performance? datagrid also supports paging. but, i suppose it will fetch all the records only to sow 25 out of it. So, can anyone please guide me on this for points like performance, less developement time etc.. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79020
DataSet serialization
Hi all,
I have my own classes that derives from DataTable,
Ex.
[Serializable]
public class MyTable1 : DataTable {
public MyTable1() : base { ... }
public MyTable1(SerializationInfo info, StreamingContext context) :
base(info, context) {}
}
My business layer create and fill the table and add it to the DataSet obectr
and send serialiazed to the client via remouting, on the UI side when I get
the table the type is simple DataTable, why ? How to serialized and
desirizlized the typed DataTable, I want to get typed DaTable
with best regards
Viorel ghilas Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79019
ODBC API
Hi
I don't know how to access the ODBC API through C#. The VS.NET provides OLEDB Data Provider but not ODBC
E.g., select * from tbl where id=
To get the data type (description) of the column 'id', the ODBC provides a function 'SQLDescribeParam()'. But, I don't know how to access this function through C#.Could anyone help me
TIA
Arrun Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79014
rergarding assembly load error
hi,
i'm trying to use Mono.Data.SybaseClient.dll (sybase ADO.net driver)
from a C# windows forms application.
on the line where i first reference the file, i get an error saying
"unable to load file Mono.Data.SybaseClient.dll". the file i've stored
in my applications debig directory.
any help please.
TIA
"Vinit". Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79013
DataColumn.Add bug? DataType parameter cannot be added
I am trying to create a DataColumn with Name and DataType parameters.
As I understand from the documentation, one of the overloads supports
creation of a column with these two parameters. When I tried
folllowing, however I get error saying
'int' denotes a 'class' where a 'variable' was expected
code
-------
DataColumn dc = new DataColumn("Name", System.Int32)
or
DataColumn dc = new DataColumn("Name",
System.Type.GetType(System.Int32))
or
MyTable.Columns.Add("Name", System.Int32)
ERROR:
-------
'int' denotes a 'class' where a 'variable' was expected
I am using .NET Framework 1.1 in Visual Studio.NET environment. Is
this a bug or am I doing something wrong Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 79000
Problem with a DataAdapter - Newbie Question
Hi
In the following code, I get an Error when I try to Fill the Dataset
String sql = "SELECT * FROM Table1 UNION SELECT * FROM Table2 UNION SELECT * FROM Table3"
SqlDataAdapter earnAggAdapter = new SqlDataAdapter(sql, con)
earnAggAdapter.Fill(tempDS, "Earnings"); // I get a "System Error" her
If I try with only the Union of Table1 and Table2 it works
Does that mean that the DataAdapter does not support more than one Union in the same statement
Is there another way to make this work
thanks
Jane Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78998
Connection to paradox 4 from vb.net application ?
Hi,
How can I connect to paradox 4.0 from my vb.net application ? Any sample
code ?
Help me ! Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78997
SqlDataReader advancing on each line of executable code within a loop
I have the following code (this is only a small snippet of the code)
compiled into a VB.Net exe file. The SqlDataReader (myReader) is
populated via an SqlCommand.ExecuteReader() method call where the
CommandType is a stored procedure on SQLServer2000.
1: myReader = myCommand.ExecuteReader()
2: Do While myReader.Read()
3: Select Case myReader.GetInt32(0)
4: Case 1
5: ' do one thing
6: Case 2
7: ' do something else
8: Case 3
9: ' do yet another thing
10: End Select
11: ' more processing of the first record
Loop
According to the SqlDataReader documentation it is supposed to advance
through the records on each call of the Read method and it is supposed
to be positioned just prior to the first record right after the
ExecuteReader method fills it.
The issue I am experincing is that the reader is positioned on the
first record after the ExecuteReader method (line 1). Consequently,
after the Raed method is called on line 2, the value of the Select
Case expression is now that of the second record. Also, after each
Case evaluation (lines 4,6, and 8) the reader is advancing. Therefore,
by the time it loops back to the Read method (Line 2) it is impossible
to determine where the reader will be positioned.
Line 1 executes: reader positioned on record 1
Line 2 executes: reader positioned on record 2
Line 3 executes: reader positioned on record 3
Line 4 executes: reader positioned on record 4
Line 6 executes: reader positioned on record 5
Line 8 executes: reader positioned on record 6
Line 9 executes: reader positioned on record 7
Line 11 through N executes: the reader advances for each executable
line of code.
Given that this is an exe file, there is no web.config file, so I'm
wondering if there is some other location that a particular setting
may be causing this behavior. I know I could put the initial data from
the stored procedure int a DataSet and then iterate through the Rows
collection, but I'd rather keep it simple with the Reader.Read
methodology. Any help or insight into the cause of the observed
behavior will be appreciated.
Thanks,
Tim Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78994
Connections Not Closing
I am using the data access application block running on Windows server 2003 and accessing SQL 2000 database (on the same box). I have some very simple code that is getting executed from a asp.net page. The code is calling executeNonQuery in a loop 30 times. I notice that after the code executes and I go into SQL Enterprise Manager and look at the open connections there are 30 open connections. Is there something I am missing ? I thought the application block would handle closing the connections. The other interesting thing is if I run the same code on Windows 2000 server accessing the database on the 2003 server everything works ok. Any ideas ??? Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78991
Sysntax Error Inserting into a table with an OleDbCommand
Hi all,
I need another set of eyes to look at a problem I'm having. I'm trying to
insert data into a Micrsoft Access 2002 table using the following SQL
statement (all fields are Text):
"Insert Into Customers (UserName, Password, FirstName, LastName, Address,
PostCode, PhoneDay, PhoneEve, PhoneMob) Values ('Jack', 'beanstalk', 'Jack',
'Beanstalk', 'Nowhere', 'Nothing', '00000000', ' ', ' ')"
As far as I can tell, there is absolutely nothing wrong with this Insert
statement but ADO.Net thinks different and I keep getting a "Syntax error in
INSERT INTO statement" error. The code I'm using is as follows:
bool AllOk = true;
RowsAffected = 0;
try
{
OleDbConnection cn = new OleDbConnection(cnString());
cn.Open();
OleDbCommand cmd = new OleDbCommand(SQLstmt, cn);
RowsAffected = cmd.ExecuteNonQuery(); <----THIS DOESN'T WORK
cn.Close();
cn.Dispose();
cn = null;
cmd.Dispose();
cmd = null;
}
catch (Exception e)
{AllOk = false;}
I'm getting desperate, can anyone tell me what I'm doing wrong.
Regards.
Wole
London.
--
===============================
Life is not fair, get used to it!
God is fair, get Him! Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78989
Problem with Odbc and DB2
Hi..
My trouble is the follow
I have a connection with System.Data.Odbc to DB Db2 v6.1
I called a storedp rocedure, this retrun 2 resultset, i fill a dataSet with a OdbcDataAdapter created with a OdbcCommand and the name storedprocedure and builded sentences with OdbcCommand Bulider.
When i execute the DataAdapter.Fill(dataSet) i got the dataset with a table but this raise a error that is:
System.Object
"{"Referencia a objeto no establecida como instancia de un objeto." }"
Thx by your help. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78988
Microsoft Dotnet, Timestamp, and Char <very odd>
Hi there,
I am calling a number of Oracle stored procedures via the Microsoft
OracleClient and the ODP.Net client (Using OracleDataAdapter.Update
and/or Direct OracleCommand.ExecuteNonQuery in both) and I am noticing
that any char parameters are over-padded with a full set (eg. 5 for
char(5)) of blank characters (even when no padding is necessary or in
addition to correct padding) whenever they are located after a
timestamp parameter. This, of course, causes an 'Inserted value too
large' error on those overpadded columns. The timestamp parameter has
a null default, and causes no problems if the parameter is not passed
and the default applied. However, if the parameter is passed with a
actual value or DBNull.Value then the error occurs.
Has anyone experienced anything like this? We are faced with making
sure timestamp parameters are always at the bottom of the parameter
list or using varchars for all logically fixed string columns.
Neither really addresses the root problem.
Thanks,
Tracy Fletcher Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78983
Query string issue with Microsoft access.
Hello Everyone,
I am having an unusual problem. I have this string that I am using as the
Select Command for an Access database:
SELECT time.employee, time.timein, time.timeout, time.ichkalt, time.ochkalt,
time.realin, time.realout, employees.FName, time.iDate, time.oDate, FROM
departments INNER JOIN (employees INNER JOIN [time] ON
employees.employeeid=time.employee) ON
departments.departmentid=employees.departmentid WHERE ((time.oDate) <= " & o
& " ) And ((employees.employeeid)= " & eid & " ) AND ((time.iDate)>= " & i &
" )
The i, o, and eid variables have been declared already. The result set
works when you remove the 'oDate <=" & o & " )' part of the statement. When
you run the query without that criteria, the result set is returned
correctly. When you add that criteria to the string, no results are
returned, even when I am inserting correct information. Does anyone have a
clue as to what to do?
Thanks in advance. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78982
Confused about DataRowVersion.Default
From MSDN on DataRowVersion.Default:
"The row the default version for the current DataRowState. For a
DataRowState value of Added, Modified or Current, the default version is
Current. For a DataRowState of Deleted, the version is Original. For a
DataRowState value of Detached, the version is Proposed."
Reading the above, I would assume that this code:
/////
ReturnValue = MyDataRow[ "MyFieldName", DataRowVersion.Default ];
/////
Should be equivalent to this code:
/////
if ( MyDataRow.RowState == DataRowState.Deleted ) {
ReturnValue = MyDataRow[ "MyFieldName", DataRowVersion.Original ];
} else {
ReturnValue = MyDataRow[ "MyFieldName", DataRowVersion.Current ];
}
/////
However, the first block of code throws DeletedRowInaccessibleException
while the second one works just fine. Am I reading the documentation wrong?
What am I missing?
Thanks,
-Steve Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78981
Problem with SQL Server
I have an asp.net form that works fine with an Access database. Now I want
to use Sql Server 2000. It is installed on the same Windows 2003 machine as
the aspx code runs. I cannot seem to have a SqlConnection successfully
connect. I use the following:
string str = "Persist Security Info=False;Integrated
Security=SSPI;database="+strDatabase+";server="+strServer+";Connect
Timeout=30";
m_SqlConnection = new SqlConnection(str);
m_SqlConnection.Open();
I get Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
I have also tried to leave out the Persist Security Info and Integrated
Security, and replace it with uid=sa;pwd=<my sa password here> but I get the
error:
Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server
connection.
The same thing occurs for any user that I add to the Enterprise Manager. At
this point I am not sure what I need to do to configure Sql Server. I know
that there are many knowledgable Sql Server users out there. Can anyone
answer my question? Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78979
odd behaviour adding record to sql database
i have created a form to submit data to an sql database, and it seems to
work, except for one glitch. one of the fields, the "creditcardnumbertxt"
text box, when entering a number with more that 7 characters, does not work.
sql says it will be truncated. in the asp code, the database, and the sql
procedure, the field is correctly set to allow a (sql datablase) char type
of 18 characters in size.
here is the error it spits back
----------------------------------
String or binary data would be truncated.The statement has been
terminated..Net SqlClient Data Provider
-----------------------------------
in the code behind the page, these are the relevant lines:
------------------------------------
cmd.Parameters.Add(New SqlParameter("@credit_card_nbr", SqlDbType.Char, 18))
cmd.Parameters.Item("@credit_card_nbr").Value = RegCreditcardnumberTXT.Text
-----------------------------------
the relevant lines in the procedure in the sql server is
-----------------------------------
@credit_card_nbr char(18),
------------------------------------
any help would be great
thanks for the help
bryan Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78977
Strange ADO.NET/Sybase/Sybase OLEDB problem
We've recently run in to a very strange problem with a windows service that
we have developed in VB.NET and that accesses a Sybase database using the
Sybase OLEDB driver via ADO.NET.
Every morning about 5am, the windows service checks a specified directory,
looking for data export files. If it finds them then it parses them, uploads
the contents to a set of temporary tables and then runs a stored procedure
(call it MergeData) to merge the needed data from the temporary tables in to
the tables used by our main system. It then fires off another couple of
stored procedures to prepare report data and then a set of reports are
generated.
This has all worked fine for a couple of months now. All of a sudden the
MergeData stored proc has started to finish prematurely before it has
completed all of the processing it is supposed to do. The strange thing is
that it doesn't raise any errors back to the windows service. It just seems
to stop doing what it was doing before it has completed all of the
processing and returns control to the windows service, which then carries on
with the other stored proc calls. The even stranger thing is that if we then
run the MergeData stored proc directly on the database it works fine and
completes all the processing it was supposed to do.
However, it gets even stranger. The same installation of the windows service
that was used on our live server was installed on our test server, the same
data export files were copied across and it works perfectly. The test server
uses the same versions of .NET framework, Sybase OLEDB driver and Sybase
database. So from the surface the test server looks to have exactly the same
software on it - both the software we developed and the third party software
we use.
Why would a stored procedure not complete when run from an application
(without throwing any errors) but work fine when run interactively from the
database (without throwing any errors)? And why would the same version of
the application on another environment work perfectly.
Both the command and connection timeouts on our OLEDB objects are set to
20mins and this timeout is not being reached. The process finishes
prematurely within about 9-10 minutes and then continues with the other
stored procs. We've had timeout issues before but they have always thrown
errors.
Has anyone seen this sort of problem using ADO.NET, Sybase or the Sybase
OLEDB driver? As you can see it's proving to be frustrating trying to
logically conclude where the problem resides. Our code seems fine on the
test server but doesn't seem to work on the live server. Therefore you'd
think it would be an environment issue, however the MergeData stored proc
works fine on the live server when run interactively from the database. Very
confusing! :-)
Sorry for the crosspost but I haven't a clue which bit of our system the
problem resides in.
Thanks for any help you can give,
Steve Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78974
SOLVED: CaseSensitive and Guid / Find()
I just though I would share with the group a small problem i ran into then
solved after banging my head on the monitor for a few hours.
For my dataset i have an XML schema that i load up. Its not quite a
strongly typed dataset, i just look for scheama changes with my data
adapter. Anyway....
In my dataset the primary key(s) of tables are uniqueidentifiers.
Unfortunately some of the columns coming from the database are coming out as
varchar() ..don't ask , i want them all as unique ID's. So looking at the
XSD schema i'll see entries like
<xs:attribute name="Record_GUID" type="xs:string"
msdata:DataType="System.Guid, mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
Loading up data into the dataset works fine. But, I found that some of the
fields defined as above are of type System.Guid others are strings. Whats
the difference ? If the field was a varchar in the DB and I forgot to run a
Cast(Record_GUID as uniqueidentifier) operation on the column, then it shows
up as System.String.
Now here's the rub... values in the fields are of type string, but when you
run a find on the object the compare seems to be binary ...that means it
ignores the Table.CaseSensitive setting.
So Table.Rows.Find( "2F79A7BA-9AD9-4D3E-835F-780FB2A9CE13")
is different than Table.Rows.Find( "2f79a7ba-9ad9-4d3e-835f-780fb2a9ce13")
even though the objects in the column are of type string.
Anyway, i'm not sure if this is a bug, or if the data adapter that fills the
schema should throw an error. I just hope this helps someone save a few
tedious hours of debugging.
Regards,
-eric Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78967
Random SQL Timeouts after Web Win2k3 upgrade.
I recently upgraded our web server from windows 2000 to windows 2003.
Our SQL server is a SQL 2k, Win 2k machine that has not been modified
at all. Both have all of the most recent updates/patches. When I
upgraded the web machine to windows 2003, we suddenly started having
random timeout problems. Every few hours or so, every sql call from
our web server would result in a timeout, or at least take a very long
time. Then a few minutes later(anywhere from 5 to 30) everything
would be fine again. Although it didn't make any sense that SQL would
be causing the problem, I did run through the profiler, and everything
seemed to okay there. There were no monster, life draining queries
running at the start of every down time. So currently, my best guess
is that it has got something to do with ado.net. Currently I'm
running a strictly ASP site on the server. I've yet to utilize any of
the .net functionality on this site, and we have no objects installed
other than our eCommerce credit card verifier. I'm using the
following connection string to connect to SQL:
DRIVER={SQL Server};SERVER=10.10.10.10;NETWORK=DBMSSOCN;UID=username;PASSWORD=password;DATABASE=dbname
Any help you can offer will be GREATLY appreciated. I've been
spinning my wheels on this for a while.
Thanks. Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78966
RollbackTransaction is not working with Oracle .Net Data Provider
Hi,
Could any one pls tell me how this rollback transaction works. I need
to call TestProc stored procedure(it has got its own transaction). I
want to rollback in my ASP.net code even if the TestProc executes
successfully.
The follg is the code part which I'm using. It is executing the
Rollback stt in the finally block but still it is not rolling back.
I'm using Oracle 8.1.7 client and the server is Oracle 7.3
Pls help me!!!
Many thanks.
-------------------------------------------------------
Dim cmdXX As OracleCommand
Dim conOra As New OracleConnection(ConnString)
Dim trnOra As OracleTransaction
conOra.Open()
trnOra = conOra.BeginTransaction()
Try
' Get Oracle Connection.
cmdRegisterCandidate = New OracleCommand("TestProc", conOra,
trnOra)
cmdRegisterCandidate.CommandType = CommandType.StoredProcedure
With cmdXX
.Parameters.Add(New OracleParameter("UserName", OracleType.VarChar,
20))
.Parameters("UserName").Direction =
ParameterDirection.Input
.Parameters("UserName").Value = sUsername
.Parameters.Add(New OracleParameter("IPAddress", OracleType.VarChar,
15))
.Parameters("IPAddress").Direction =
ParameterDirection.Input
.Parameters("IPAddress").Value = sIPAddress
.Parameters.Add(New OracleParameter("Err", OracleType.VarChar, 100))
.Parameters("Err").Direction =
ParameterDirection.Output
.ExecuteNonQuery()
End With
Catch ex As Exception
WriteToLog(......)
Finally
trnOra.Rollback()
conOra.Close()
End Try
------------------------------------------------------- Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78961
connection pooling and commits
I am using ado.net connection pooling and am calling stored procedures using ExecuteNonQuery. My manager says the following: "if you are using pooling, and you don't do your commit, then the implied transaction will remain open until the connection closes...if someone else jumps into the connection, then they can actually rollback your updates.
Is this true? After calling ExecuteNonQuery do I have to manually commit Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78959
How to save image in SQL ?
Hi !
I´ve a problem saving images in SQL DB. It acccepts images size>=8k and
I can´t figure out why ? This is the code I use to upload the images. It
comes from ASP.Alliance. I thought it would work properly but ??
Sub UploadImage(sender as object, e as EventArgs)
Dim imgstream As Stream = ImageFile.PostedFile.InputStream
Dim imgdata(ImageFile.PostedFile.ContentLength) As Byte
imgstream.Read(imgdata, 0, ImageFile.PostedFile.ContentLength)
Dim objConn as New SQLClient.SQLConnection("Some connection string")
Dim cmdText = "INSERT INTO wm_images(Name, Type, Image) VALUES(
@imgtitle, @imgtype, @image)"
Dim objcmd As New SqlClient.SqlCommand(cmdText, objConn)
Dim titleparam As New SqlClient.SqlParameter("@imgtitle",
SqlDbType.NVarChar, 100)
Dim typeparam As New SqlClient.SqlParameter("@imgtype",
SqlDbType.NVarChar, 100)
Dim imgparam As New SqlClient.SqlParameter("@image", SqlDbType.Image)
titleparam.Value = ImageTitle.Text
typeparam.Value = ImageFile.PostedFile.ContentType
imgparam.Value = imgdata
objcmd.Parameters.Add(titleparam)
objcmd.Parameters.Add(typeparam)
objcmd.Parameters.Add(imgparam)
objconn.Open()
objcmd.ExecuteNonQuery()
objconn.close()
End Sub
Has anyone any ideas I would be most greatful !
Regards
OM "Myggan"
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78958
ado.net , sql server, and asymptotic time complexity
We are new to relational databases in general
and sql server in particular.
Is a search for a record by indexes
O(log n)?
Is the insert and delete operation O(n log n)?
We are assuming that a record update without
changing the primary/foreign key values is
also O (log n). Correct?
thanks in advance
jay widman Tag: Timeout problem, please help - Stored procedure.sql [1/1] Tag: 78954
begin 755 Stored procedure.sql
M0U)%051%(%!23T-%1%5212!P<F]V82`@($%3#0H)55!$051%(')E<&%R=&D-
F"@E3150@<F5P87)T;R`]("A54%!%4BAR97!A<G1O*2D-"D=/#0H
`
end