473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

2.0 DataSet Connection Timeout only on first load?

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 System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSni Error(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni (DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPac ket(Int32 bytesExpected)
at System.Data.SqlClient.TdsParser.ConsumePreLoginHan dshake(Boolean encrypt, Boolean trustServerCert, Boolean& marsCapable)
at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
at System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at SRE.MySummitTableAdapters.UsersTableAdapter.GetUse rById(Guid Id)
at SRE.MembershipProviders.HPMembershipProvider.GetUs er(String username, Boolean userIsOnline)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

All subsequent request to this dataset works just fine, so the sql
server IS there, and connecting just dandy.

In this instance above, all the data is doing is returning a single row
using a custom query on the table adapter. The part that throw an
exception the first time is this sequence:
Dim usersAdapter As New MyStuffTableAdapters.UsersTableAdapter
Dim users As MyStuff.UsersDataTable = usersAdapter.GetUserById(userId)
Even if I set the connection manually:
Dim usersAdapter As New MySummitTableAdapters.UsersTableAdapter
usersAdapter.Connection = New Data.SqlClient.SqlConnection(ConfigurationManager. ConnectionStrings("MyStuff").ConnectionString)
Dim users As MySummit.UsersDataTable = usersAdapter.GetUserById(userId)
it still throws the above timeout error on the first request only.
To make matters ever more strange:
Dim usersAdapter As New MyStuffTableAdapters.UsersTableAdapter
Debug.WriteLine(usersAdapter.Connection.Connection String)
Dim users As MyStuff.UsersDataTable = usersAdapter.GetUserById(userId)


The second line there prints the correct connection string, the one used
everywhere else... the same one that works for all request but the
first... so the value IS getting loaded... Of course, as soon as we call
the GetUserById method, we get the connection timeout above.. on the
first request.

Just to reinforce matters, on the first request after unloading all
sites fails with the connection timeout errors above, but an SQL
Profiler trace shows not connection attempt is made at all. For the
second and subsqeuent requests, the dataset queries work just fine, and
the SQL profile trace shows their activity.

At this point, I'm stumped. I don't know what is going on, or how to
prevent the data from crapping out on the first request.

Any ideas?

-=Chris
Mar 23 '06 #1
0 2153

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

Similar topics

0
by: SPD | last post by:
I've been researching this issue with little luck. Here's the situation: We have a few users on slow dialup connections who are posting data from forms. Frequently, they get script timeout...
1
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to...
0
by: Vijay Balki | last post by:
I am fetching data in DataSet - myDataSet, from a remote database using a Web Service in my VB.NET client..Once I fetch it I store the data in XML file (myXMLFile) using the WriteXML method of the...
3
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...
6
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 ...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
2
by: Scotty | last post by:
I get stuck to write an update, insert and delete command, i am looking for some help to start Whats the best way to update 2 tables toe the database (Access) below my code used to load my...
7
by: =?Utf-8?B?Sm9obiBTdGFnZ3M=?= | last post by:
Hello, Please read this all before giving an answer :) I'm doing some troubleshooting on a web application that my company wrote. It's written in asp.net 1.1. The error that the Event viewer...
0
by: rickbear | last post by:
Hi group... I am having big difficulties with dataset and xsd schemas. First I dedicate a specific schema to a dataset. Then I use an adapter to fill each table in the dataset. But the problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
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...

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.