Timeout Error when insert data into Database(MSDE)
when I insert data from DataRow to Database(MSDE2000)
with ADO.NET , sometime it can insert into the database
, but sometime it can not which has an error message "Err
no.5 Timeout Expired"
[ These events have the same environment and infromation.]
In the error case,
- The program will show the error dialogbox.
- I press OK. button to accept the error message.
- I press INSERT [ button ] again. It can be
inserted into the database.
Dim cn As OleDbConnection
Dim command As OleDbCommand = New
OleDbCommand()
cn = New OleDbConnection
(strConnectionString)
cn.Open()
command.Connection = cn
command.CommandText = strInsertCommand
command.CommandType =
CommandType.Text
rowsAffected =
command.ExecuteNonQuery() ' The error has been occured in
this line.
Note :-
strInsertCommand ="INSERT INTO testTable
(id,Person_id,USNumber,UAddress,UnitType,SNumber,Stype,User
Type,CName,Notes,DL_id,Priority,Stime,HB) VALUES ( 1994,
17, 0, 0, 0,N'43532', 2, 1,N'435435435',N'43543543',
1,NULL, 0, 1)"
I try to solve this problem by set the connectionstring
with Connect TimeOut= 60.
However It will be an error within 40 seconds.
Comment :
UPDATE and DELETE statement Its have no error.