System Error when executing a data adapter object in 1.1

G

Guest

Running VS 2003 on 1.1 framework.
Every time my code trys to execute the line ' da.Fill(dt)', I get following
exception:

~~~~~~~~~~~~~~~~~~
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in system.data.dll
Additional information: System error.
~~~~~~~~~~~~~~~~~~

Here is my code:
~~~~~~~~~~~~~~~~~~
Dim dt As New System.Data.DataTable
Dim da As SqlClient.SqlDataAdapter

Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = strQuery
cmd.Connection = _docConn

_docConn.Open()
da = New SqlClient.SqlDataAdapter(cmd)
da.Fill(dt)
_docConn.Close()
~~~~~~~~~~~~~~~~~~

Any ideas?
I appreciate anyones help on this.
Thanks Gerhard
 
N

Naveen

The sql exception class has lot more properties to give you more
details as to why it is failing. Example the procedure property gives
info gets the name of the stored procedure or remote procedure call
(RPC) that generated the error. I guess if you look in to the exception
object you would be able to figure out the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top