By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Losing SQL Connection

P: n/a
While working on a few projects I have this annoying issue whereby my
computer is losing the connection to my SQL database. I have to save my
work exit VS log out of windowsXP and log back in, relaunch VS and load my
program to resume. I'm getting the following error about every 10 minutes.

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in system.data.dll

Additional Information: System error.

The error ocurrs on this line:
SqlDataAdapter1.Fill(ClientListDS1)

I'm hoping someone can shed some light on what may be causing this. The SQL
database is on a SBS2003 server.

Thanks,
Mike
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi,

Try enclosing the update command in a try catch block so you get
a better error message.

Try
SqlDataAdapter1.Fill(ClientListDS1)
Catch ex as exception
messagebox.show(ex.tostring)
end try

Ken
----------------
"Mike" <th********@yahoo.com> wrote in message
news:Cp******************@tornado.texas.rr.com...
While working on a few projects I have this annoying issue whereby my
computer is losing the connection to my SQL database. I have to save my
work exit VS log out of windowsXP and log back in, relaunch VS and load my
program to resume. I'm getting the following error about every 10 minutes.

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in system.data.dll

Additional Information: System error.

The error ocurrs on this line:
SqlDataAdapter1.Fill(ClientListDS1)

I'm hoping someone can shed some light on what may be causing this. The SQL
database is on a SBS2003 server.

Thanks,
Mike

Nov 21 '05 #2

P: n/a
Or better yet catch a SQLexception type for the best info:

Catch ex as SqlClient.SqlException
"Ken Tucker [MVP]" wrote:
Hi,

Try enclosing the update command in a try catch block so you get
a better error message.

Try
SqlDataAdapter1.Fill(ClientListDS1)
Catch ex as exception
messagebox.show(ex.tostring)
end try

Ken
----------------
"Mike" <th********@yahoo.com> wrote in message
news:Cp******************@tornado.texas.rr.com...
While working on a few projects I have this annoying issue whereby my
computer is losing the connection to my SQL database. I have to save my
work exit VS log out of windowsXP and log back in, relaunch VS and load my
program to resume. I'm getting the following error about every 10 minutes.

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in system.data.dll

Additional Information: System error.

The error ocurrs on this line:
SqlDataAdapter1.Fill(ClientListDS1)

I'm hoping someone can shed some light on what may be causing this. The SQL
database is on a SBS2003 server.

Thanks,
Mike

Nov 21 '05 #3

P: n/a
It is returning:
System.Data.SqlClient.SqlException: Cannot generate SSPI context.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
at System.data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in
C:\vbdotnet\testapps\WindowsApplication2\Form1.vb: line1282

That was a lot of typing. So, most search results indicate that this is a
rights issue; however, I have tested various permission settings and have
not been able to resolve the issue. Also, it doesn't occur right away. - I
have access to the SQL data for about 10 minutes before I lose the
connection. I have my username set in AD for 'Account is trusted for
delegation' and the issue is reproducible while logged in as administrator
as well..... I'm at a loss....

Thanks,
Mike
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:Om**************@TK2MSFTNGP15.phx.gbl...
Hi,

Try enclosing the update command in a try catch block so you
get
a better error message.

Try
SqlDataAdapter1.Fill(ClientListDS1)
Catch ex as exception
messagebox.show(ex.tostring)
end try

Ken
----------------
"Mike" <th********@yahoo.com> wrote in message
news:Cp******************@tornado.texas.rr.com...
While working on a few projects I have this annoying issue whereby my
computer is losing the connection to my SQL database. I have to save my
work exit VS log out of windowsXP and log back in, relaunch VS and load my
program to resume. I'm getting the following error about every 10
minutes.

An unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in system.data.dll

Additional Information: System error.

The error ocurrs on this line:
SqlDataAdapter1.Fill(ClientListDS1)

I'm hoping someone can shed some light on what may be causing this. The
SQL
database is on a SBS2003 server.

Thanks,
Mike

Nov 21 '05 #4

P: n/a
Thanks,
I changed the catch statement but it returns the same results - see my
response to Ken for details on the error.

Thanks,
mike

"Zorpiedoman" <no*********@beatles.com> wrote in message
news:68**********************************@microsof t.com...
Or better yet catch a SQLexception type for the best info:

Catch ex as SqlClient.SqlException
"Ken Tucker [MVP]" wrote:
Hi,

Try enclosing the update command in a try catch block so you
get
a better error message.

Try
SqlDataAdapter1.Fill(ClientListDS1)
Catch ex as exception
messagebox.show(ex.tostring)
end try

Ken
----------------
"Mike" <th********@yahoo.com> wrote in message
news:Cp******************@tornado.texas.rr.com...
While working on a few projects I have this annoying issue whereby my
computer is losing the connection to my SQL database. I have to save my
work exit VS log out of windowsXP and log back in, relaunch VS and load
my
program to resume. I'm getting the following error about every 10
minutes.

An unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in system.data.dll

Additional Information: System error.

The error ocurrs on this line:
SqlDataAdapter1.Fill(ClientListDS1)

I'm hoping someone can shed some light on what may be causing this. The
SQL
database is on a SBS2003 server.

Thanks,
Mike

Nov 21 '05 #5

P: n/a
"Mike" <th********@yahoo.com> schrieb
It is returning:
System.Data.SqlClient.SqlException: Cannot generate SSPI context.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
at System.data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection
connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs
e) in C:\vbdotnet\testapps\WindowsApplication2\Form1.vb: line1282

That was a lot of typing.


Typing the callstack? Why not use the clipboard? :-)

Maybe the people in the ADO.net group can help you:
microsoft.public.dotnet.framework.adonet

Armin

Nov 21 '05 #6

P: n/a
Mike,

I assume that you are creating and disposing all the time your connection.
If not you can have a problem that there are to many connections active and
have problems with the pooling.

It can as well be your connectiontimeout.
http://msdn.microsoft.com/library/de...meouttopic.asp

I hope this helps,

Cor
Nov 21 '05 #7

P: n/a
Thanks Cor,
Disposing of the connection appears to have resolved the issue. I'm
surprised that (1) using the wizard to create the connection doesn't take
care of this automatically (2) the beginner books I am studying don't hit
this point emmediately (they mayy touch on it later in the books).
Nontheless, thank you for the help.

Mike

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Mike,

I assume that you are creating and disposing all the time your connection.
If not you can have a problem that there are to many connections active
and have problems with the pooling.

It can as well be your connectiontimeout.
http://msdn.microsoft.com/library/de...meouttopic.asp

I hope this helps,

Cor

Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.