Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Connection string For SQL Server 2005 Express.

Posted on 2007-03-30
3
Medium Priority
?
853 Views
Last Modified: 2013-11-27
I have started learning about SQL 2005 express.  I quite often populate a list box using the datareader, so this was the first thing I wanted to try. I currently use the following connection strings to connect to SQL 2000, but cannot get them to work with SQL Server Express.

SQL Client:
ConString = "Data Source=127.0.0.1;Initial Catalog=myDatabase;User Id=Auser;Password=pwd;"
OLEdb Client:
ConString = "Provider=SQLOleDB; Data Source=127.0.0.1;Initial Catalog=MyDatabase;User Id=Auser;Password=pwd;"

Many thanks in advance.

0
Comment
Question by:jonesgj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
JackOfPH earned 750 total points
ID: 18827995
Here is the list of connection strings...

http://www.connectionstrings.com/?carrier=sqlserver2005

In your program is there any error returned?
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18828538
If it is a default instance of SQL Express, try this:

SQL Client:
ConString = "Data Source=127.0.0.1\SQLEXPRESS;Initial Catalog=myDatabase;User Id=Auser;Password=pwd;"
OLEdb Client:
ConString = "Provider=SQLOleDB; Data Source=127.0.0.1\SQLEXPRESS;Initial Catalog=MyDatabase;User Id=Auser;Password=pwd;"
0
 

Author Comment

by:jonesgj
ID: 18828605
Thanks Jack,

I have been here already, but this time I used the attach string :

    Dim constring As String = "Server=.\SQLExpress;AttachDbFilename=" & Application.StartupPath & "\AlphaTest.mdf;Database=AlphaTest;Trusted_Connection=Yes;"

And this worked ....  I must not try to solve problems late at night ....  Thanks again
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

636 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