error: an exception of type: {System.InvalidOperationException} occurred

N

newtodotnet

All
I am trying to get a very simple datastore to return data from SQL
Server on my machine (see code below). However I keep getting
ServerVersion <error: an exception of type:
{System.InvalidOperationException} occurred> error.

I have been using data reader object through out the ASP application
without any problems.
This seems to be datastore and data adapter error only. Any idea as to
what could be the cause of this problem?
I have tried different connect string including draging it from the
connection string with in the Visual Studio, nothing seems to be
working

Here is the code


Dim connString As String
Dim strSQL As String
Dim oTable As DataTable = New DataTable

connString = "Server=10.10.0.10;User
ID=user;Password=user123;"

strSQL = "SELECT ID,FullName,Address1 from PortalUser"

Dim oAdapter = New SqlClient.SqlDataAdapter(strSQL,
connString)
oAdapter.Fill(oTable)

I am using SQL Server Version: Microsoft SQL Server 2000 - 8.00.534
(Intel X86) Nov 19 2001 13:23:50 Copyright (c) 1988-2000 Microsoft
Corporation Developer Edition on Windows NT 5.0 (Build 2195: Service
Pack 4)

VS Version 7.1.3088
Framework version 1.1.4322

Any help is much appreciated
TIA
 
G

Guest

Thanks for the reply
I have tried with the database name as well with same results. Created a whole new project and solution still same problem. Not sure whats going on
 

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