Connect to Database...
I have install the Northwind sample database by entering at the DOS prompt
osql -E -S (local)\sqlexpress -i instnwnd.sql
which runs through lots of numbers so I assume has all gone ok.
When in VS I go to "Tools/Connect to Database...", choose "Microsoft SQL Server" and ".NET Framework Data Provider for SQL Server", then in the next dialog there is one server in the combo which I select, but I cannot get any databases to appear in the "Select or enter a database name" combo.
[543 byte] By [
Chardiot] at [2007-12-25]
I think you need a SqlServer software is installed in your machine
and in c# you type sever name on combobox like: (local)
then your database name will appear
I do have SQLExpress installed and the configuration manager is on my Windows Start Menu which shows "SQL Server (SQLExpress)" as running but "SQL Server Browser" is stopped. Is this correct?
If I type in (local) I get an error message occurred while establishing a connection to server.
sorry,I do not use Sqlexpress
? server= . / sqlexpress ( no spaces)
may www.connectionstrings.com helps you....
this info bellow help you?
..........................................
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?
SqlConnection myConnection = new SqlConnection("server=CS-DD928D0CB525\\SQLEXPRESS;" +
"Trusted_Connection=yes;" + "database=master;" +
"connection timeout=30");
................................
SQLExpress should work just like SQL Server. Why are you using OleDb? You should be using a SQLConnection.
maybe you can check the sqlpress first on you PC by below methodes.
1. is there is folder C:\Program Files\Microsoft SQL Server\90\Tools\Binn ?
2. check the service named SQL Server (SQLEXPRESS)