PC Review


Reply
Thread Tools Rate Thread

Connection Timeout

 
 
sam
Guest
Posts: n/a
 
      8th Jul 2005
When I use ASP.Net via ADO.Net to retrieve data from MS SQL Server 2000, it
is always prompt error message "Timeout" if the number record is larger than
1 million.

May I know what is the best practise for pool large records for my case,
please?

Or it is limitation on ADO.Net or ASP.Net or .Net framework 1.1?


ASP.Net Coding
-----------------
Server.ScriptTimeout = 9000

Dim constr_GL_3a_2 As String = "server='SQLSVR'; user id='sa';
password='sa'; Database='ERP_ARCHIVAL';Connect Timeout=1200"
Dim sqlcon_GL_3a_2 As System.Data.SqlClient.sqlconnection = New
System.Data.SqlClient.sqlconnection(constr_GL_3a_2)
Dim sqlcmd_GL_3a_2 As System.Data.SqlClient.SqlCommand = New SqlCommand()
Dim sqlda_GL_3a_2 As New system.Data.SqlClient.sqldataAdapter()
Dim sqlprm1_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
Dim sqlprm2_GL_3a_2 As New system.Data.SqlClient.SqlParameter()

Try
sqlcmd_GL_3a_2 = sqlcon_GL_3a_2.CreateCommand

sqlcmd_GL_3a_2.CommandText = "[General_Ledger]"

sqlcmd_GL_3a_2.CommandType = commandtype.StoredProcedure

sqlprm1_GL_3a_2 =
sqlcmd_GL_3a_2.Parameters.Add("@DateFrom",SqlDbType.Int,6)
sqlprm1_GL_3a_2.value = FlagFrDate

sqlprm2_GL_3a_2 =
sqlcmd_GL_3a_2.Parameters.Add("@DateTo",SqlDbType.Int,6)
sqlprm2_GL_3a_2.value = FlagToDate

sqlda_GL_3a_2.SelectCommand = sqlcmd_GL_3a_2
sqlcon_GL_3a_2.Open
sqlcmd_GL_3a_2.ExecuteNonQuery
Finally
sqlcon_GL_3a_2.Close()
sqlcon_GL_3a_2.Dispose()
End Try

constr_GL_3a_2 = Nothing
sqlcon_GL_3a_2 = Nothing
sqlcmd_GL_3a_2 = Nothing
sqlda_GL_3a_2 = Nothing


 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      8th Jul 2005
The default timeout for a command is 30 seconds. You need to set it to a
larger timeout, if you need more time to execute your query.

However, do you really need to retrieve 1 million records all at once?

"sam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When I use ASP.Net via ADO.Net to retrieve data from MS SQL Server 2000,
> it is always prompt error message "Timeout" if the number record is larger
> than 1 million.
>
> May I know what is the best practise for pool large records for my case,
> please?
>
> Or it is limitation on ADO.Net or ASP.Net or .Net framework 1.1?
>
>
> ASP.Net Coding
> -----------------
> Server.ScriptTimeout = 9000
>
> Dim constr_GL_3a_2 As String = "server='SQLSVR'; user id='sa';
> password='sa'; Database='ERP_ARCHIVAL';Connect Timeout=1200"
> Dim sqlcon_GL_3a_2 As System.Data.SqlClient.sqlconnection = New
> System.Data.SqlClient.sqlconnection(constr_GL_3a_2)
> Dim sqlcmd_GL_3a_2 As System.Data.SqlClient.SqlCommand = New SqlCommand()
> Dim sqlda_GL_3a_2 As New system.Data.SqlClient.sqldataAdapter()
> Dim sqlprm1_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
> Dim sqlprm2_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>
> Try
> sqlcmd_GL_3a_2 = sqlcon_GL_3a_2.CreateCommand
>
> sqlcmd_GL_3a_2.CommandText = "[General_Ledger]"
>
> sqlcmd_GL_3a_2.CommandType = commandtype.StoredProcedure
>
> sqlprm1_GL_3a_2 =
> sqlcmd_GL_3a_2.Parameters.Add("@DateFrom",SqlDbType.Int,6)
> sqlprm1_GL_3a_2.value = FlagFrDate
>
> sqlprm2_GL_3a_2 =
> sqlcmd_GL_3a_2.Parameters.Add("@DateTo",SqlDbType.Int,6)
> sqlprm2_GL_3a_2.value = FlagToDate
>
> sqlda_GL_3a_2.SelectCommand = sqlcmd_GL_3a_2
> sqlcon_GL_3a_2.Open
> sqlcmd_GL_3a_2.ExecuteNonQuery
> Finally
> sqlcon_GL_3a_2.Close()
> sqlcon_GL_3a_2.Dispose()
> End Try
>
> constr_GL_3a_2 = Nothing
> sqlcon_GL_3a_2 = Nothing
> sqlcmd_GL_3a_2 = Nothing
> sqlda_GL_3a_2 = Nothing
>
>



 
Reply With Quote
 
sam
Guest
Posts: n/a
 
      11th Jul 2005
I had set timeout at following :
- web.config
- ISS 6.0
- ASP.Net page

But it is seem un-retrievable for millions record....

I also notice that MS SQL Server 2000 (Standard Edition) is capable to store
over millions but unable to retrieval via stored procedure or ADO.Net...

Could it possible that MS SQL Server 2000 (Standard Edition) have constraint
of retrieval millions record and only MS SQL Server 2000 (Enterprise
Edition) could do so...

Please advise...

"Marina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The default timeout for a command is 30 seconds. You need to set it to a
> larger timeout, if you need more time to execute your query.
>
> However, do you really need to retrieve 1 million records all at once?
>
> "sam" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> When I use ASP.Net via ADO.Net to retrieve data from MS SQL Server 2000,
>> it is always prompt error message "Timeout" if the number record is
>> larger than 1 million.
>>
>> May I know what is the best practise for pool large records for my case,
>> please?
>>
>> Or it is limitation on ADO.Net or ASP.Net or .Net framework 1.1?
>>
>>
>> ASP.Net Coding
>> -----------------
>> Server.ScriptTimeout = 9000
>>
>> Dim constr_GL_3a_2 As String = "server='SQLSVR'; user id='sa';
>> password='sa'; Database='ERP_ARCHIVAL';Connect Timeout=1200"
>> Dim sqlcon_GL_3a_2 As System.Data.SqlClient.sqlconnection = New
>> System.Data.SqlClient.sqlconnection(constr_GL_3a_2)
>> Dim sqlcmd_GL_3a_2 As System.Data.SqlClient.SqlCommand = New
>> SqlCommand()
>> Dim sqlda_GL_3a_2 As New system.Data.SqlClient.sqldataAdapter()
>> Dim sqlprm1_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>> Dim sqlprm2_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>>
>> Try
>> sqlcmd_GL_3a_2 = sqlcon_GL_3a_2.CreateCommand
>>
>> sqlcmd_GL_3a_2.CommandText = "[General_Ledger]"
>>
>> sqlcmd_GL_3a_2.CommandType = commandtype.StoredProcedure
>>
>> sqlprm1_GL_3a_2 =
>> sqlcmd_GL_3a_2.Parameters.Add("@DateFrom",SqlDbType.Int,6)
>> sqlprm1_GL_3a_2.value = FlagFrDate
>>
>> sqlprm2_GL_3a_2 =
>> sqlcmd_GL_3a_2.Parameters.Add("@DateTo",SqlDbType.Int,6)
>> sqlprm2_GL_3a_2.value = FlagToDate
>>
>> sqlda_GL_3a_2.SelectCommand = sqlcmd_GL_3a_2
>> sqlcon_GL_3a_2.Open
>> sqlcmd_GL_3a_2.ExecuteNonQuery
>> Finally
>> sqlcon_GL_3a_2.Close()
>> sqlcon_GL_3a_2.Dispose()
>> End Try
>>
>> constr_GL_3a_2 = Nothing
>> sqlcon_GL_3a_2 = Nothing
>> sqlcmd_GL_3a_2 = Nothing
>> sqlda_GL_3a_2 = Nothing
>>
>>

>
>



 
Reply With Quote
 
Marina
Guest
Posts: n/a
 
      11th Jul 2005
Like I said, the issue is the command timeout. So you need to set it on the
SqlCommand object. This is not related to IIS or anything like that, I would
expect the same behavior in a windows app.

So you should be able to retrieve 1 million records. But you probably want
to re-examine your requirement to get 1 million records into memory all at
once.

"sam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I had set timeout at following :
> - web.config
> - ISS 6.0
> - ASP.Net page
>
> But it is seem un-retrievable for millions record....
>
> I also notice that MS SQL Server 2000 (Standard Edition) is capable to
> store over millions but unable to retrieval via stored procedure or
> ADO.Net...
>
> Could it possible that MS SQL Server 2000 (Standard Edition) have
> constraint of retrieval millions record and only MS SQL Server 2000
> (Enterprise Edition) could do so...
>
> Please advise...
>
> "Marina" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> The default timeout for a command is 30 seconds. You need to set it to a
>> larger timeout, if you need more time to execute your query.
>>
>> However, do you really need to retrieve 1 million records all at once?
>>
>> "sam" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> When I use ASP.Net via ADO.Net to retrieve data from MS SQL Server 2000,
>>> it is always prompt error message "Timeout" if the number record is
>>> larger than 1 million.
>>>
>>> May I know what is the best practise for pool large records for my case,
>>> please?
>>>
>>> Or it is limitation on ADO.Net or ASP.Net or .Net framework 1.1?
>>>
>>>
>>> ASP.Net Coding
>>> -----------------
>>> Server.ScriptTimeout = 9000
>>>
>>> Dim constr_GL_3a_2 As String = "server='SQLSVR'; user id='sa';
>>> password='sa'; Database='ERP_ARCHIVAL';Connect Timeout=1200"
>>> Dim sqlcon_GL_3a_2 As System.Data.SqlClient.sqlconnection = New
>>> System.Data.SqlClient.sqlconnection(constr_GL_3a_2)
>>> Dim sqlcmd_GL_3a_2 As System.Data.SqlClient.SqlCommand = New
>>> SqlCommand()
>>> Dim sqlda_GL_3a_2 As New system.Data.SqlClient.sqldataAdapter()
>>> Dim sqlprm1_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>>> Dim sqlprm2_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>>>
>>> Try
>>> sqlcmd_GL_3a_2 = sqlcon_GL_3a_2.CreateCommand
>>>
>>> sqlcmd_GL_3a_2.CommandText = "[General_Ledger]"
>>>
>>> sqlcmd_GL_3a_2.CommandType = commandtype.StoredProcedure
>>>
>>> sqlprm1_GL_3a_2 =
>>> sqlcmd_GL_3a_2.Parameters.Add("@DateFrom",SqlDbType.Int,6)
>>> sqlprm1_GL_3a_2.value = FlagFrDate
>>>
>>> sqlprm2_GL_3a_2 =
>>> sqlcmd_GL_3a_2.Parameters.Add("@DateTo",SqlDbType.Int,6)
>>> sqlprm2_GL_3a_2.value = FlagToDate
>>>
>>> sqlda_GL_3a_2.SelectCommand = sqlcmd_GL_3a_2
>>> sqlcon_GL_3a_2.Open
>>> sqlcmd_GL_3a_2.ExecuteNonQuery
>>> Finally
>>> sqlcon_GL_3a_2.Close()
>>> sqlcon_GL_3a_2.Dispose()
>>> End Try
>>>
>>> constr_GL_3a_2 = Nothing
>>> sqlcon_GL_3a_2 = Nothing
>>> sqlcmd_GL_3a_2 = Nothing
>>> sqlda_GL_3a_2 = Nothing
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      11th Jul 2005
I agree. When you go to the library for information on a subject, do you
fetch the entire shelf of books at once--or (in your case) the entire
library, stuff it into your Volkswagen beetle and try to get home to read
them all before your library sends the cops after you?

Consider that ADO (and all of the data access interfaces) are "query"
interfaces. They are designed to let you ask questions (query) the database.
The database is designed and optimized to answer questions--not act as a
file server. If find yourself fetching a million rows to process them as a
block (and there are applications that must do this (like graphics and
cartography)), then I usually recommend that this processing go on at the
server using an Extended Stored Procedure and rolled-up data be returned to
the client via file IO. If you're simply moving data from one source to
another, ADO is the poorest possible choice short of paper tape. DTS or BCP
are designed and tuned to move bulk data. So, you have to process the data
before it's committed to the database. Never post unvalidated data to a
production table--post it to a work table and use a stored procedure to
revalidate the rules and criteria--then post the valid data to the server.
Does this put a big load on the server? Yup it does. That's why we build
servers that have multiple processors tons of RAM and fast hard drives. It's
almost always faster to process bulk data in this way--orders of magnitude
faster.

hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Marina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Like I said, the issue is the command timeout. So you need to set it on
> the SqlCommand object. This is not related to IIS or anything like that, I
> would expect the same behavior in a windows app.
>
> So you should be able to retrieve 1 million records. But you probably want
> to re-examine your requirement to get 1 million records into memory all at
> once.
>
> "sam" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I had set timeout at following :
>> - web.config
>> - ISS 6.0
>> - ASP.Net page
>>
>> But it is seem un-retrievable for millions record....
>>
>> I also notice that MS SQL Server 2000 (Standard Edition) is capable to
>> store over millions but unable to retrieval via stored procedure or
>> ADO.Net...
>>
>> Could it possible that MS SQL Server 2000 (Standard Edition) have
>> constraint of retrieval millions record and only MS SQL Server 2000
>> (Enterprise Edition) could do so...
>>
>> Please advise...
>>
>> "Marina" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> The default timeout for a command is 30 seconds. You need to set it to a
>>> larger timeout, if you need more time to execute your query.
>>>
>>> However, do you really need to retrieve 1 million records all at once?
>>>
>>> "sam" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> When I use ASP.Net via ADO.Net to retrieve data from MS SQL Server
>>>> 2000, it is always prompt error message "Timeout" if the number record
>>>> is larger than 1 million.
>>>>
>>>> May I know what is the best practise for pool large records for my
>>>> case, please?
>>>>
>>>> Or it is limitation on ADO.Net or ASP.Net or .Net framework 1.1?
>>>>
>>>>
>>>> ASP.Net Coding
>>>> -----------------
>>>> Server.ScriptTimeout = 9000
>>>>
>>>> Dim constr_GL_3a_2 As String = "server='SQLSVR'; user id='sa';
>>>> password='sa'; Database='ERP_ARCHIVAL';Connect Timeout=1200"
>>>> Dim sqlcon_GL_3a_2 As System.Data.SqlClient.sqlconnection = New
>>>> System.Data.SqlClient.sqlconnection(constr_GL_3a_2)
>>>> Dim sqlcmd_GL_3a_2 As System.Data.SqlClient.SqlCommand = New
>>>> SqlCommand()
>>>> Dim sqlda_GL_3a_2 As New system.Data.SqlClient.sqldataAdapter()
>>>> Dim sqlprm1_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>>>> Dim sqlprm2_GL_3a_2 As New system.Data.SqlClient.SqlParameter()
>>>>
>>>> Try
>>>> sqlcmd_GL_3a_2 = sqlcon_GL_3a_2.CreateCommand
>>>>
>>>> sqlcmd_GL_3a_2.CommandText = "[General_Ledger]"
>>>>
>>>> sqlcmd_GL_3a_2.CommandType = commandtype.StoredProcedure
>>>>
>>>> sqlprm1_GL_3a_2 =
>>>> sqlcmd_GL_3a_2.Parameters.Add("@DateFrom",SqlDbType.Int,6)
>>>> sqlprm1_GL_3a_2.value = FlagFrDate
>>>>
>>>> sqlprm2_GL_3a_2 =
>>>> sqlcmd_GL_3a_2.Parameters.Add("@DateTo",SqlDbType.Int,6)
>>>> sqlprm2_GL_3a_2.value = FlagToDate
>>>>
>>>> sqlda_GL_3a_2.SelectCommand = sqlcmd_GL_3a_2
>>>> sqlcon_GL_3a_2.Open
>>>> sqlcmd_GL_3a_2.ExecuteNonQuery
>>>> Finally
>>>> sqlcon_GL_3a_2.Close()
>>>> sqlcon_GL_3a_2.Dispose()
>>>> End Try
>>>>
>>>> constr_GL_3a_2 = Nothing
>>>> sqlcon_GL_3a_2 = Nothing
>>>> sqlcmd_GL_3a_2 = Nothing
>>>> sqlda_GL_3a_2 = Nothing
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection timeout set to 5 sec but takes longer to timeout Avi Microsoft C# .NET 4 10th Mar 2010 04:06 PM
Connection timeout - Sleeping Processes - Connection Pools? Why oh Why mark.ellul@gmail.com Microsoft ADO .NET 4 17th Aug 2006 03:56 PM
Connection Timeout =?Utf-8?B?SkR1cG9udA==?= Microsoft ADO .NET 1 22nd Jul 2004 02:43 AM
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Guoqi Zheng Microsoft ASP .NET 4 3rd Jun 2004 07:39 PM
another "InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool" error Jeff Braun Microsoft ADO .NET 1 30th Jul 2003 12:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 AM.