Solved

OLE DB Connection - SQL Server

Posted on 2008-10-07
7
178 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 142

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 142

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 38
How to open a link from vb.net app 3 22
Changing the Source of an ADO Recordset while it's open 4 35
Create XML 5 46
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now