473,779 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Connection timeout while trying to fill a dataset

Hi All..

I am experiencing Timeouts after about 30-40 seconds when trying to
fill a dataset from SQL.

I have seen a lot of posts mentioning to set the commandtimeout
property, but how do you do that on an SQLAdapter? I setting a
connection timeout on the SQL Connector, but that didn't help.

Here is my code.. Can anyone help???? BTW: I am returning about 1
million records (hope the dataset can handle it...

Dim SQLLink As String =
"server=(local) ;Trusted_Connec tion=Yes;Databa se=FTO;Connecti on
Timeout=600"

Dim SQLConn As SqlConnection = New SqlConnection(S QLLink)
Dim daSQL As SqlDataAdapter

'Get OrderItem
sSql = "select * from tbl_OrderItems inner join tbl_OrderLog on
tbl_OrderItems. Ordernum = tbl_OrderLog.FO rdernum "
sSql += "where tbl_OrderLog.St artTD <= '" & DateRange1 & "' order by
tbl_orderlog.Or dernum"

daSQL = New SqlDataAdapter( sSql, SQLLink)
daSQL.Fill(dsOr derItems, "t1")
Thanks,
Robert
Nov 20 '05 #1
3 17689
Robert

You can explicitly create and assign the SelectCommand to the DataAdapter
rather than using SQL in the constructor, or this should work...

daSQL = New SqlDataAdapter( sSql, SQLLink)
daSQL.SelectCom mand.CommandTim eout = 120
daSQL.Fill(dsOr derItems, "t1")

though I haven't tested it

Regards

Paul

"Robert Brown" <rb****@edium.c om> wrote in message
news:bd******** *************** **@posting.goog le.com...
Hi All..

I am experiencing Timeouts after about 30-40 seconds when trying to
fill a dataset from SQL.

I have seen a lot of posts mentioning to set the commandtimeout
property, but how do you do that on an SQLAdapter? I setting a
connection timeout on the SQL Connector, but that didn't help.

Here is my code.. Can anyone help???? BTW: I am returning about 1
million records (hope the dataset can handle it...

Dim SQLLink As String =
"server=(local) ;Trusted_Connec tion=Yes;Databa se=FTO;Connecti on
Timeout=600"

Dim SQLConn As SqlConnection = New SqlConnection(S QLLink)
Dim daSQL As SqlDataAdapter

'Get OrderItem
sSql = "select * from tbl_OrderItems inner join tbl_OrderLog on
tbl_OrderItems. Ordernum = tbl_OrderLog.FO rdernum "
sSql += "where tbl_OrderLog.St artTD <= '" & DateRange1 & "' order by
tbl_orderlog.Or dernum"

daSQL = New SqlDataAdapter( sSql, SQLLink)
daSQL.Fill(dsOr derItems, "t1")
Thanks,
Robert

Nov 20 '05 #2
Cor
Hi Robert,
I am experiencing Timeouts after about 30-40 seconds when trying to
fill a dataset from SQL.
\\\watch typos not checked
dim cmd as new sqlcommand(sSql , SQLLink)
cmd.CommandTime out = 60
daSQL = New SqlDataAdapter( cmd) daSQL.Fill(dsOr derItems, "t1")

///
I hope this helps,

Cor
Nov 20 '05 #3
rb****@edium.co m (Robert Brown) wrote in message news:<bd******* *************** ***@posting.goo gle.com>...
Hi All..

I am experiencing Timeouts after about 30-40 seconds when trying to
fill a dataset from SQL.

I have seen a lot of posts mentioning to set the commandtimeout
property, but how do you do that on an SQLAdapter? I setting a
connection timeout on the SQL Connector, but that didn't help.

Here is my code.. Can anyone help???? BTW: I am returning about 1
million records (hope the dataset can handle it...

Dim SQLLink As String =
"server=(local) ;Trusted_Connec tion=Yes;Databa se=FTO;Connecti on
Timeout=600"

Dim SQLConn As SqlConnection = New SqlConnection(S QLLink)
Dim daSQL As SqlDataAdapter

'Get OrderItem
sSql = "select * from tbl_OrderItems inner join tbl_OrderLog on
tbl_OrderItems. Ordernum = tbl_OrderLog.FO rdernum "
sSql += "where tbl_OrderLog.St artTD <= '" & DateRange1 & "' order by
tbl_orderlog.Or dernum"

daSQL = New SqlDataAdapter( sSql, SQLLink)
daSQL.Fill(dsOr derItems, "t1")
Thanks,
Robert


Hey there Robert

Dare I ask why you are retrieving so many records? There is probably
another way to acheive your goal

Sam
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
18694
by: Nifty | last post by:
After creating a routine to select from past ADODB connection strings, I found that it takes 60 seconds to timeout! I found the Microsoft article below <http://support.microsoft.com/default.aspx?scid=kb;en-us;225859> but wonder if anyone has a work around.
7
33239
by: C# beginner | last post by:
I'm struggling with a timeout problem today. ConnectionString = "Integrated Security=true;Database=MyDatabase;Data Source=(local); Connection Timeout = 180;"; My connection string is set as above. A stored proc in my code takes about 50 secs. to execute and return. But, I get a connection time out error as follows. SqlException occurred when trying to execute stored proc
9
47206
by: Nikolay Petrov | last post by:
How to fill DataSet from stored procedure?
4
8361
by: Shachar | last post by:
Hi All, When I call a web service on the IIS 5 or 6 I see the connection count increase by 1 user, but after a minute the connection is close, connection count decrease by 1 user, I see it on the Performance Monitor on Web Service\Current Connection.
6
2481
by: Laura K | last post by:
This is probably a simple question but I want to make sure I am doing it right. I have a spoc with two select statements which results in two tables. Very Basic --------------------------------------------------------------------------------- @strProductCode nvarchar (50)
0
2185
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another project, and load that project under IIS6/ASP/2003 using COM, it fails with the folowing error on the FIRST request only: > Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at...
6
59949
by: michael sorens | last post by:
I have used the visual designer to create a series of DataGridViews populated from SQLServer data. A typical call is: myCountsTableAdapter.Fill(myDataSet.myCounts); My application actually connects to different systems during a run; on some of these the default timeout is adequate, but on one system I get an SQL exception that simply reports "Timeout expired". The default timeout shows as "15" using this line of code.
1
4224
by: dedipya | last post by:
Environment W2003K with Oracle 10 client connected to oracle using oracle odp provider.orcle is on solaries machine. while filling the dataset .net is throughing the error "argument was out of the range of valid values". we are getting error when trying to fill the dataset with more than 16 columns. if any date column is avaible in retrivels then fill dataset method is throwing the bellow error. Parameter name: Year, Month, and Day...
3
3110
by: =?Utf-8?B?QXho?= | last post by:
Is there a limitation on the number of (sequential) opened connection for SQL Server User Instances? The following method will run to about the 240th iteration then will receive a timeout exception (SqlException. "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."). If User Instance=false then the method will execute to completion. Note that connection pooling is off just...
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.