vb.net version 1.1 Can't connect to SQL server2000 on a server.

G

Guest

Can someone tell me why I can't use the data adapter to SQL server 2000 on my
server using vb.net 1.1? When I try from my workstation, I get a good test
connection message, but then VB will tell me the following message "Unable to
connect to database. It is only possible to connect to SQL Server Desktop
Engine Database with this version of Visual Studio."

Can someone tell me how to get around this, or what I need to buy to enable
this data connection?

Thanks a lot for any help.
 
G

Guest

fsu_mike said:
Can someone tell me why I can't use the data adapter to SQL server 2000 on my
server using vb.net 1.1? When I try from my workstation, I get a good test
connection message, but then VB will tell me the following message "Unable to
connect to database. It is only possible to connect to SQL Server Desktop
Engine Database with this version of Visual Studio."

Can someone tell me how to get around this, or what I need to buy to enable
this data connection?

Thanks a lot for any help.
Mike,

This is the very first problem I encountered when I started using dot net.
For us, the problem was that we only had the Standard edition, whereas we
actually needed the Enterprise Architect edition, as it had far more SQL
Server 2000 connectivity features, namely the Server Explorer in the IDE.
 
G

Guest

Hi,

You should be able to connect to the database. Can you post the code that
you are using to connect so the group may diagnose your problem better? I
have provided some sample code for you below.

I hope this helps.
---------------------------------------
//Sample connection code
//NOTE: the <> means put your values there...leave out the <> (e.g.
<servername> = MyServer )
using System.Data;
using System.Data.SqlClient;
.....
string strConn = @"Data Source=<servername>;Initial
Catalog=<databasename>;User Id=<username>;Password=<password>;";
SqlConnection conn = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter("<SQL Statement...SELECT *
FROM...>",conn);
DataSet ds = new DataSet();
da.Fill(ds);
 
G

Guest

Thanks Brian, I am not using code but the Server Explorer to do the
connection. According to the the reply before yours he says I should get the
Enterprise Edition, is this true. Will try your code right now, but I would
rather have a user choice the connection at run time, any link to code for
that? So right now would like to connect to Server1, and the pubs database
on SQL Server 2000.


thanks.
 
G

Guest

Hi,

If you are using Standard Edition the Servers node is not available in the
Server Explorer. I have posted a link below to the documentation stating
this. However you can connect to a database via code. You should be able to
plug in your information in the code that I provided to connect to the pubs
database on your Sql Server. I have modified the sample for you with the
information that you provided.

I hope this helps.
-----------------------------------

//link to documentation - you should be able to find out everything you
would like to know about Database connections and server explorer here
http://msdn.microsoft.com/library/d...odatasourceswithserverexplorer.asp?frame=true

//Modified sample code
//NOTE: the <> means put your values there...leave out the <> (e.g.
<servername> = MyServer )
using System.Data;
using System.Data.SqlClient;
.....
string strConn = @"Data Source=Server1;Initial Catalog=pubs;User
Id=<username>;Password=<password>;";
SqlConnection conn = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Authors",conn);
DataSet ds = new DataSet();
da.Fill(ds);
 
G

Guest

Thanks Brian!

I was teaching myself how to connect using a book reference to the server
explore, will use code instead.

Mike
 

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