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.

RE: vb.net version 1.1 Can't connect to SQL server2000 on a server. by m00nm0nkey

m00nm0nkey
Wed Jan 26 05:17:01 CST 2005

"fsu_mike" wrote:

> 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.

RE: vb.net version 1.1 Can't connect to SQL server2000 on a server. by BrianBrown

BrianBrown
Wed Jan 26 07:39:06 CST 2005

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);

RE: vb.net version 1.1 Can't connect to SQL server2000 on a server by fsumike

fsumike
Wed Jan 26 07:49:01 CST 2005

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.

"Brian Brown" wrote:

> 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);

RE: vb.net version 1.1 Can't connect to SQL server2000 on a server by BrianBrown

BrianBrown
Wed Jan 26 08:47:15 CST 2005

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/default.asp?url=/library/en-us/vsintro7/html/vxoriconnectingtodatasourceswithserverexplorer.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);


RE: vb.net version 1.1 Can't connect to SQL server2000 on a server by fsumike

fsumike
Wed Jan 26 08:55:06 CST 2005

Thanks Brian!

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

Mike

"Brian Brown" wrote:

> 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/default.asp?url=/library/en-us/vsintro7/html/vxoriconnectingtodatasourceswithserverexplorer.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);
>

RE: vb.net version 1.1 Can't connect to SQL server2000 on a server by BrianBrown

BrianBrown
Wed Jan 26 09:09:02 CST 2005

Great Mike! I am glad that I could help.

Good Luck.
-----------------