Computing.Net > Forums > Programming > C# SQLExpress connection String

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

C# SQLExpress connection String

Reply to Message Icon

Name: wolfmaster
Date: December 26, 2005 at 06:17:33 Pacific
OS: xp sp2
CPU/Ram: Athlon 2200+ 512MB
Comment:

Hi
I'm trying to connect to SQLExpress database. I'm using c# express and it's sqlexpress that came with it.
I want to use OleDbConnection but I can't fiqure out what is the right connection string. The database file is in the project folder (local).
Using the follwing connection String :
@"Provider=SQLNCLI.1;Integrated Security=true;Persist Security Info=False;AttachDbFilename=|DataDirectory|\Database1.mdf;Data Source=.\SQLEXPRESS";

Returns the following error:
Could not connect to data source: No error message available.

Help please?


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: December 26, 2005 at 10:30:31 Pacific
Reply:

Try connectionstrings.com.

SQLExpress should work just like SQL Server. Why are you using OleDb? You should be using a SQLConnection.

Good luck,
-SN


Report Offensive Follow Up For Removal
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C# SQLExpress connection String

Sql connection string VB6 www.computing.net/answers/programming/sql-connection-string-vb6/12336.html

VB6 Mysql remote connection string www.computing.net/answers/programming/vb6-mysql-remote-connection-string/13709.html

Connection String www.computing.net/answers/programming/connection-string/10202.html