|
 |
pro_vb_dotnet thread: Trouble to connect to SQL Server 2000
Message #1 by Alex.Ayzin@v... on Wed, 03 Apr 2002 23:12:33 -0500
|
|
Try to verify all is well with the SQL2000 first.
1) run Enterprise manager. Can you see your local SQL 2k running?
If not, you may need to start it first.
2) once you know the SQL2000 is up and running, try out Query Analzer next.
To make this tool work you need to know a SQL server and at least one
database with at least 1 table in it.
MS SQL comes with the pubs installed in it. Create a "Select * FROM ..." one
of the tables available in the pubs database. You probably need to select
the Pubs database as the Master database is typically the default.
3) If that worked, you now know all the things you need to connect to
SQL2000 from vb.net apps.
The SQLConnection string you need is something like: "Data
Source=(local);Database=Pubs"
This works if your use windows authetication, if you used SQL authetication
then you need to append ";User ID=myloginName;Password=Mypassword" to the
end of the connection string.
The code looks something like:
Dim SQLConn as new SQLConnection("Data Source=(local);Database=Pubs")
SQLConn.open
The open command will fail if SQL2000 is not available, if the Pubs database
is not available, or if you do not have permission to open the Pubs
database.
If the MSSQL2000 is not on you rlocal computer, substitute the server name
for (local).
Oh, and you need a reference the SQLDB name space for your application.
----- Original Message -----
From: <Alex.Ayzin@v...>
To: "pro_VB_dotnet" <pro_vb_dotnet@p...>
Sent: Wednesday, April 03, 2002 8:12 PM
Subject: [pro_vb_dotnet] Trouble to connect to SQL Server 2000
> Hi,
> Please, help me out!
> I just installed SQL Server2000 on my machine and I'm trying to
> establish a connection between my VS.net and server 2000 for the first
> time. What I did was that I created some form in VB.Net with
> OleDBDataAdapter control. It promted me for Data Adapter Configuration
> Wizard. I choose the correct driver for SQL Server, but when I was
> trying to create new connection it failed to connect. It's a stand-alone
>
> machine, I don't have any network connections on it(besides my internet
> dial-up). The wizard was trying to bring me on-line all the time
> promting me to connect to the Internet with no other options. My SQL
> Server 2000 registered as 'local' server. I run Win XP Pro with VS.Net
> and newly installed SQL Server 2000. Please, help me resolve it. I went
> thru all of the documentation on MSDN and VS.net Help + all of .net boks
>
> I have - nothing. Thanks in advance,
> --Alex
>
>
>
>
|
|
 |