Solved

OLE DB Connection - SQL Server

Posted on 2008-10-07
7
182 Views
Last Modified: 2012-05-05
OLE DB Connection - SQL Server
0
Comment
Question by:JPTenore
  • 3
  • 2
  • 2
7 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 22657298
You can find more information about the connectionstring for sql-server at
http://connectionstrings.com/?carrier=sqlserver2005
Using connection as new SqlConnection("Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
     connection.Open()
     ' Use the connection
 End Using

Open in new window

0
 

Author Comment

by:JPTenore
ID: 22657312
Can you give me an example of
Data Source=myServerAddress;Initial Catalog=myDataBase    ....   part
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22657337
>Can you give me an example of
please look in the link provided. it's all there.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 53

Expert Comment

by:Dhaest
ID: 22657339

Some explanations:
myServerAddress = this is the name of your server (or ip-address) (example: Company001)
Initial Catalog = this is the name of your database (example:  OrderDb)
myUsername & myPassword: the name and password of the database user that you use to login to your database.

Using connection as new SqlConnection("Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
     connection.Open()
     ' Use the connection
 End Using

If you are using integrated security (your username for sql server is the same as windows, you just need this string:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22657343
resp... you have to know the dynamic part, ie servername, database etc...
0
 

Author Comment

by:JPTenore
ID: 22657368
NO!  Sorry didn't mean to do this
0
 

Author Comment

by:JPTenore
ID: 22657377
For some reason it tought I wanted to Close this Question.??????
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question