PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Help setting up ADO.NET connection in VB.NET

Reply

Help setting up ADO.NET connection in VB.NET

 
Thread Tools Rate Thread
Old 30-06-2003, 03:35 PM   #1
Carlos
Guest
 
Posts: n/a
Default Help setting up ADO.NET connection in VB.NET


Need help with setting up data connection in ADO.NET. Checked message
boards but have not found solution. Any help would be appreciated.
Here is my situation:

BACKGROUND: I'm using Visual Basic.NET Standard 2002 on XP Pro
running MSDE (the one that came w/ Visual Studio).

Here is the problem: when setting up a data connection, I am able to
see the MSDE SQL server running on my local machine form the Server
Explorer. The connection seems just fine, since I can browse all
tables, see all their contents, etc.

The problem begins when I try to creat the ADO.NET connection. I drag
one of the tables onto a form, and VS begins generating the connection
code. However, an error comes up and reports that "SQL Server does
not exist or access denied". Afer investigating, I've tried the
following changes to my connection string settings, but to no avail:

1. VS configured the SQL Server on my machine (SJ-CGONZALEZ) with the
following name SJ-CGONZALEZ\VSdotNET. I edited the connection string
to include an escape character for the "\" that appears. In other
words, connection string became: data source=SJ-CGONZALEZ\\VSdotNET.
It didn't work.

2. I tried using named pipes instead of tcp-ip, adding the following
to the connection string: net=dbnmpntw. That didn't help.

3. I tried doing points 1 and 2 a the same time, but it didn't work.

What should I be trying next? Any help would be greatly appreciated.

Thanks,
Carlos
  Reply With Quote
Old 30-06-2003, 03:47 PM   #2
Val Mazur
Guest
 
Posts: n/a
Default Re: Help setting up ADO.NET connection in VB.NET

Hi,

What do you mean "data connection"? Is it same application? Is it ASP .NET
application? Looks like you do not have permissions to connect to the
database

--
Val Mazur
Microsoft MVP

"Carlos" <cagonzalez@yahoo.com> wrote in message
news:474b1345.0306300735.42bd385c@posting.google.com...
> Need help with setting up data connection in ADO.NET. Checked message
> boards but have not found solution. Any help would be appreciated.
> Here is my situation:
>
> BACKGROUND: I'm using Visual Basic.NET Standard 2002 on XP Pro
> running MSDE (the one that came w/ Visual Studio).
>
> Here is the problem: when setting up a data connection, I am able to
> see the MSDE SQL server running on my local machine form the Server
> Explorer. The connection seems just fine, since I can browse all
> tables, see all their contents, etc.
>
> The problem begins when I try to creat the ADO.NET connection. I drag
> one of the tables onto a form, and VS begins generating the connection
> code. However, an error comes up and reports that "SQL Server does
> not exist or access denied". Afer investigating, I've tried the
> following changes to my connection string settings, but to no avail:
>
> 1. VS configured the SQL Server on my machine (SJ-CGONZALEZ) with the
> following name SJ-CGONZALEZ\VSdotNET. I edited the connection string
> to include an escape character for the "\" that appears. In other
> words, connection string became: data source=SJ-CGONZALEZ\\VSdotNET.
> It didn't work.
>
> 2. I tried using named pipes instead of tcp-ip, adding the following
> to the connection string: net=dbnmpntw. That didn't help.
>
> 3. I tried doing points 1 and 2 a the same time, but it didn't work.
>
> What should I be trying next? Any help would be greatly appreciated.
>
> Thanks,
> Carlos



  Reply With Quote
Old 30-06-2003, 04:19 PM   #3
Carlos Gonzalez
Guest
 
Posts: n/a
Default Re: Help setting up ADO.NET connection in VB.NET

Val,

I am trying/learning to make a Windows Application that will connect to
a database. What I mean by "Data Connection" is that the Server
Explorer within Visual Studio is able to see and explore my SQL server
(on local machine). That leads me to believe that the config problem is
not with my server but with the VB code in my application.

The problem begins when I try to generate the VB code so that my
Application will be able to make the connection, create the data
adapter, and then generate a data set. I let Visual Studio generate
the connection code (connection string, etc.). The problem, I assume,
is in the code that is being generated. That is why I have tried the
two changes I detailed in the original email.

Also, I've tried changing the login from Windows Login to SQL Login, but
have had the same problem present itself.

I'm a bit of a beginner at VB.NET, so I appreciate your patience and
help.

Thanks,
Carlos

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  Reply With Quote
Old 30-06-2003, 05:02 PM   #4
Val Mazur
Guest
 
Posts: n/a
Default Re: Help setting up ADO.NET connection in VB.NET

Hi,

Could you post full connection string? Actually you should not escape \
character. This way SQL Server distincts named instances

--
Val Mazur
Microsoft MVP

"Carlos Gonzalez" <cagonzalez@yahoo.com> wrote in message
news:#mzEUNyPDHA.1748@TK2MSFTNGP11.phx.gbl...
> Val,
>
> I am trying/learning to make a Windows Application that will connect to
> a database. What I mean by "Data Connection" is that the Server
> Explorer within Visual Studio is able to see and explore my SQL server
> (on local machine). That leads me to believe that the config problem is
> not with my server but with the VB code in my application.
>
> The problem begins when I try to generate the VB code so that my
> Application will be able to make the connection, create the data
> adapter, and then generate a data set. I let Visual Studio generate
> the connection code (connection string, etc.). The problem, I assume,
> is in the code that is being generated. That is why I have tried the
> two changes I detailed in the original email.
>
> Also, I've tried changing the login from Windows Login to SQL Login, but
> have had the same problem present itself.
>
> I'm a bit of a beginner at VB.NET, so I appreciate your patience and
> help.
>
> Thanks,
> Carlos
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



  Reply With Quote
Old 30-06-2003, 08:50 PM   #5
Carlos Gonzalez
Guest
 
Posts: n/a
Default Re: Help setting up ADO.NET connection in VB.NET


Val, this is the full connection string:

"data source=SJ-CGONZALEZ\VSdotNET;initial catalog=Holdings;integrated
security=SSPI;persist security info=False;workstation
id=SJ-CGONZALEZ;packet size=4096"

Like I said, this is generated by VS automatically. I've tried
different configurations (SQL login, Named Pipes), which result in
different connection strings, but none have worked.

Thanks for your help!

-Carlos


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off