Click here to Skip to main content
15,911,848 members
Home / Discussions / Database
   

Database

 
AnswerRe: Puzzled by converting date on an export Pin
Mike Dimmick6-Aug-07 12:38
Mike Dimmick6-Aug-07 12:38 
GeneralRe: Puzzled by converting date on an export Pin
Jack Fleet6-Aug-07 12:43
Jack Fleet6-Aug-07 12:43 
QuestionSQL Query Pin
sangramkp6-Aug-07 7:06
sangramkp6-Aug-07 7:06 
AnswerRe: SQL Query Pin
andyharman6-Aug-07 7:15
professionalandyharman6-Aug-07 7:15 
GeneralRe: SQL Query Pin
sangramkp6-Aug-07 7:40
sangramkp6-Aug-07 7:40 
GeneralRe: SQL Query Pin
andyharman6-Aug-07 8:17
professionalandyharman6-Aug-07 8:17 
AnswerRe: SQL Query Pin
Pete O'Hanlon6-Aug-07 22:05
mvePete O'Hanlon6-Aug-07 22:05 
QuestionTimeout while reading data from database Pin
Muhammad Ahmed6-Aug-07 6:45
Muhammad Ahmed6-Aug-07 6:45 
I am getting following exception in the code below
Exception occurs when closing connection,
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The SqlCommandTimeout is already set 0 as you can see in the code below,
When i search records for first time it works fine, but the exceptions start coming second time or third time onwards,..



Protected Overrides Sub DataPortal_Fetch(ByVal criteria As Object)

' Load object data from database.
Dim crit As criteria = DirectCast(criteria, criteria)
Dim con As New SqlConnection(DB())
// db string is something like
//"data source=hurst\SQL2000_SP4;initial catalog=MYDB_OOP_11;Connection Timeout=60;user=asd_user;password=asd_user;"
Dim cmd As New SqlCommand
con.Open()

Try
With cmd
.Connection = con
.CommandType = CommandType.StoredProcedure
.CommandTimeout = 0

' Set up and call appropriate stored procedure.
If crit.IsSimpleList Then
.CommandText = DBObject & "_info_simple_get"

With .Parameters
// some code for adding params for SP
End With
Else
.CommandText = DBObject & "_info_get"

With .Parameters
// adding param for Stored Procedure here

End With
End If

Dim dr As New SafeDataReader(.ExecuteReader)
Try
Me.Fetch(dr, crit.IsSimpleList)
// The fectch function loops for each read of datareader and creates a new object, passing it dr object, each object then reads its column from dr
Finally
dr.Close()
End Try


End With
Finally
con.Close() // I get exception here..on closing..
End Try
End Sub

Is it something because of improper use of DataReader ? or what is it, I really couldnt figure out, I have Tried using GC.collect() etc , but no use,
please help
Ahmed

Ahmed

AnswerRe: Timeout while reading data from database Pin
vimal_yet6-Aug-07 22:23
vimal_yet6-Aug-07 22:23 
AnswerRe: Timeout while reading data from database Pin
Pete O'Hanlon6-Aug-07 22:38
mvePete O'Hanlon6-Aug-07 22:38 
QuestionDataAdapter.Update Problem Pin
MohammadAmiry6-Aug-07 6:12
MohammadAmiry6-Aug-07 6:12 
Questionproblem with pop3 mail box Pin
shaikshavali6-Aug-07 2:17
shaikshavali6-Aug-07 2:17 
AnswerRe: problem with pop3 mail box Pin
Marek Grzenkowicz6-Aug-07 22:30
Marek Grzenkowicz6-Aug-07 22:30 
QuestionDate Range Pin
Brendan Vogt5-Aug-07 20:50
Brendan Vogt5-Aug-07 20:50 
AnswerRe: Date Range Pin
Krish - KP5-Aug-07 21:10
Krish - KP5-Aug-07 21:10 
QuestionReducing the Execution time of the Sql Server 2000 Stored procedure. Pin
tonic_valan5-Aug-07 20:32
tonic_valan5-Aug-07 20:32 
AnswerRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
Marek Grzenkowicz5-Aug-07 21:02
Marek Grzenkowicz5-Aug-07 21:02 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
tonic_valan5-Aug-07 22:03
tonic_valan5-Aug-07 22:03 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
Marek Grzenkowicz5-Aug-07 23:47
Marek Grzenkowicz5-Aug-07 23:47 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
tonic_valan6-Aug-07 1:50
tonic_valan6-Aug-07 1:50 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
Marek Grzenkowicz6-Aug-07 21:57
Marek Grzenkowicz6-Aug-07 21:57 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
tonic_valan7-Aug-07 20:33
tonic_valan7-Aug-07 20:33 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
Marek Grzenkowicz7-Aug-07 23:12
Marek Grzenkowicz7-Aug-07 23:12 
GeneralRe: Reducing the Execution time of the Sql Server 2000 Stored procedure. Pin
tonic_valan8-Aug-07 23:34
tonic_valan8-Aug-07 23:34 
QuestionSQL 2005 Default Scripts Directory Pin
jareddavies5-Aug-07 14:09
jareddavies5-Aug-07 14:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.