Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'System.Data.SqlClient.SqlException' occurred

Status
Not open for further replies.

jeffmoore

Programmer
Aug 29, 2003
301
US
Still stuck here .... the code runs till the last line then hang for about 10-15 seconds then returns the error shown below the code sample. This is basically straight out of and example....


Dim oSQLConn As SqlConnection = New SqlConnection
oSQLConn.ConnectionString = "Initial Catalog=rathmisc;User Id=sysadm;Password=sysadm;"
Dim MyDataAdaptor As System.Data.sqlclient.SqlDataAdapter
Dim MyDataTable As New DataSet
Dim ds As New DataSet
MyDataAdaptor = New SqlDataAdapter("select * from tbl_data_laser_1", oSQLConn)
MyDataAdaptor.Fill(ds)



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

Additional information: System error.



tia jeff
 
Try putting in oSQLConn.Open().

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
I put the stmt oSQLConn.Open() right before the MyAdaptor.fill(ds) line .....


Same error.....
 
Try defining the Data Source in the connection string.
 
okay the #$@$%^ connection string wrong ... I didn't have the data source= myserver in there....


thanks all .... boy this ain't easy....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top