Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
I'm using VB.net 2008 with SQL Server which come with VB pack.
Now I want to establish a new connection.
I doing following steps:-
1.Create New connection
2. OLE DB(ADO)
3. Microsoft OLE DB Provider for SQL Server
4. Next, ask for Server Name, User Id,Password

Kindly guide How i get this infromation of Servername, User Id & Password for working next
Posted

I think the default is;

localhost\sqlexpress

the administrator account should have default access to the SQL server if using windows authentication.
 
Share this answer
 
If you are connecting to your local sql server, you can either use your machine name or period "." (with out the quotes)
 
Share this answer
 
hello..
Is not necessary to connect to SQL Server databases inserting user id and password .. can be used windows authentication

VB
Dim connStr As String = "provider=sqloledb;data source=.\sqlexpress;database=dbname;integrated security=sspi"
Dim conn As New System.Data.OleDb.OleDbConnection(connStr)
conn.Open()


if you have a user id and password by creating a user in sql server


Dim connStr As String = "provider=sqloledb;data source=.\sqlexpress;database=dbname;user id=user;password=pass"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900