473,769 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TimeOut on SqlDataAdapter. Fill

Dan
I've created a web form which fills a DataGrid with a DataSet generated from
the SqlDataAdapter. Fill method. The adapter's query takes about 30 seconds
to complete when I run it in the SQL Server Query Analyzer, but when I run
it from my web page I kept getting a TimeOut exception. So then, as an
experiment, I changed the way I created the adapter to the following:

SqlConnection conn = new SqlConnection(m _Conn);
SqlCommand sqlCommand = new SqlCommand(m_Qu ery, conn);
sqlCommand.Comm andTimeout = 0;
m_Adapter = new SqlDataAdapter( sqlCommand);

However, I'm still getting the TimeOut exception on the adapter.Fill method.
What do I need to do to make this work? The relevant portion of the
exception reads as follows:
System.Data.Sql Client.SqlExcep tion: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding. at
System.Data.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or cmdBehavior,
RunBehavior runBehavior, Boolean returnStream) at
System.Data.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or behavior) at
System.Data.Sql Client.SqlComma nd.System.Data. IDbCommand.Exec uteReader(Comma n
dBehavior behavior) at
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Com mon.DbDataAdapt er.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
Nov 18 '05 #1
1 9735
Dan
Never mind. I had an extraneous databound column in my datagrid.
"Dan" <da*@dontspamme .com> wrote in message
news:ej******** ******@TK2MSFTN GP10.phx.gbl...
I've created a web form which fills a DataGrid with a DataSet generated from the SqlDataAdapter. Fill method. The adapter's query takes about 30 seconds to complete when I run it in the SQL Server Query Analyzer, but when I run
it from my web page I kept getting a TimeOut exception. So then, as an
experiment, I changed the way I created the adapter to the following:

SqlConnection conn = new SqlConnection(m _Conn);
SqlCommand sqlCommand = new SqlCommand(m_Qu ery, conn);
sqlCommand.Comm andTimeout = 0;
m_Adapter = new SqlDataAdapter( sqlCommand);

However, I'm still getting the TimeOut exception on the adapter.Fill method. What do I need to do to make this work? The relevant portion of the
exception reads as follows:
System.Data.Sql Client.SqlExcep tion: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding. at
System.Data.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at
System.Data.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or behavior) at System.Data.Sql Client.SqlComma nd.System.Data. IDbCommand.Exec uteReader(Comma n dBehavior behavior) at
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Com mon.DbDataAdapt er.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)

Nov 18 '05 #2

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

Similar topics

0
2190
by: Polly | last post by:
I have a datatable i am filling with database data using the SqlDataAdapter. This works fine using the test database. When i run it on the production database, it will sometimes work but sometimes i get the error: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." I have looked around online and tried increasing the
2
1273
by: Dan | last post by:
I've created a web form which fills a DataGrid with a DataSet generated from the SqlDataAdapter.Fill method. The adapter's query takes about 30 seconds to complete when I run it in the SQL Server Query Analyzer, but when I run it from my web page I kept getting a TimeOut exception. So then, as an experiment, I changed the way I created the adapter to the following: SqlConnection conn = new SqlConnection(m_Conn); SqlCommand sqlCommand =...
3
16055
by: Matt | last post by:
I'm having an issue with returning a large amount of data into a dataset. When the query returns thousands of lines of data (in Query Analyzer it can take 2 minutes) I receive the following error: Message: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding....
7
3003
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise code. i.e. if the SqlDataAdapter uses a connection to the one database for a select statement and I want to do a second select statement on exactly the same database, can I reuse the SqlDataAdapter? I ask because I want to put both 'select'...
3
17689
by: Robert Brown | last post by:
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
9
2887
by: pmcguire | last post by:
I have a vb.NET solution with a Windows Application project that contains my user interface and a Class Library project that contains (among other things) a class I call DataAccessComponent. This class inherits from System.ComponentModel.Component and contains a single SQLConnection object and a bunch of SQLDataAdapter object which reference it. It also exposes 2 methods per SQLDataAdapter object that all look more or less the same. For...
0
2036
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. It seems that the download file code is executing before letting the previous code to finish. Even the message print code (message.Text="...";) is not executed.
3
2978
by: Lou Civitella | last post by:
I am setting the source of a crystal report and sometimes get a Timeout error. How can I increase the timeout? It seems to timeout after 30 seconds. Here is a snippet of the code that I use. Using VB 2005 Dim oRpt As New ReportDocument Dim strConnectionString As String = "Data Source=Server1;Initial
2
35410
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a timout problem when I call "DataAdapter.Fill". When I debug, I see that all timeout settings are correct, ConnectionTimeout is 0 and also CommandTimeout is 0. But when I call the fill method I get: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} System.Exception {System.Data.SqlClient.SqlException}
1
1972
by: Leon Mayne | last post by:
Hello, I had a chunk of code that would execute a stored proc to migrate data between two systems (takes a few minutes) and then performs some data manipulation on the migrated data. This was working fine when I was using SqlCommand.CommandTimeout = 0. After getting the basics to work I wanted to wrap the whole block in a transaction to roll back everything if something went wrong: Dim cnMigrate As New SqlConnection(pConnectionString)
0
9579
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
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
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...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
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
5294
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...
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.