Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Saturday, February 25, 2012

Cannot Connect to SQLExpress

Hi everyone,

I'd like to ask some help. My prob may seem very basic but as a matter of fact i'm a newbie to .net and sql 2005. I'm trying out this product but I encountered an error. After installing sql server express 2005, and using my server instance name (the default name "SQlExpress" during install) and password to connect, I always get the error "Timeout expired. The timeout period elapsed prior to completion... blah blah blah". Though I entered the right user name and password (which I entered during install), I always get this error.

Additional: I indicated mixed mode during install and defined my sa account and password

Anyone who can help me.. like adjusting configs, etc...
Kobe

Is the SQL Server service started?

Also, refer to the blog posted here:

http://blogs.msdn.com/sqlexpress/

|||Thanks Rob! This helped me a lot.|||Chaps,

I have the same problem. (Including the novice attributes).

What was the fix? I looked through the blog as suggested but could not readily find the cure.

MRW

Cannot Connect to SQLExpress

Hi everyone,

I'd like to ask some help. My prob may seem very basic but as a matter of fact i'm a newbie to .net and sql 2005. I'm trying out this product but I encountered an error. After installing sql server express 2005, and using my server instance name (the default name "SQlExpress" during install) and password to connect, I always get the error "Timeout expired. The timeout period elapsed prior to completion... blah blah blah". Though I entered the right user name and password (which I entered during install), I always get this error.

Additional: I indicated mixed mode during install and defined my sa account and password

Anyone who can help me.. like adjusting configs, etc...
Kobe

Is the SQL Server service started?

Also, refer to the blog posted here:

http://blogs.msdn.com/sqlexpress/

|||Thanks Rob! This helped me a lot.|||Chaps,

I have the same problem. (Including the novice attributes).

What was the fix? I looked through the blog as suggested but could not readily find the cure.

MRW

Tuesday, February 14, 2012

Cannot connect to MSDE from C# code

Hello everybody and happy holidays to all.
I'm new to C#, and I appologize for this basic question.
I am trying to connect to an SQL database from a very short C# program, which I found on the Microsoft site, demonstrating this subject.
Here is my setup:
Windows 2000 Professional
dotNET Framework 1.1 with sp1 installed
MSDE 2000
Note: I do not own nor do I have Visual Studio.NET of any kind installed.

Now, here is what works:
osql -E -S localhost\vsdotnet
1>
And I can create and populate a database, which I called mydb.

Now, in my simple C# demo program I have this line

SqlConnection mycon = new SqlConnection("server=localhost;database=mydb;trusted_connection=true");

And the program compiles OK using "csc" command. But when I run it, I get this message:
Couldn't Open Connection to server=localhost;database=mydb;trusted_connection=true

Could anybody comment on what am I missing?
Thanks.The complete answer can't be given without knowing if you chose to use intgrated NT security or not during the MSDE installation. Either which way your connection string is incomplete.

If you installed MSDE using NT integrated security your connection string should also contain: Persist Security Info=False;Integrated Security=SSPI;

If not you will have to provide a username password pair such as:
uid=sa;pwd=secret;

Hope this helps

Cheers

Gary