Friday, February 17, 2012

Database creation from inside of Visual C#

When I create a database from inside of Visual C# Express, why can't I view it with the manager from the SQL Server Express Edition? I mean, it does not appear at all. Is there any problem?

hi,

chances are you are using a User Instance, so that you can usually not "browse" your database using a "standard" connection via SQL Server Management Studio.. the article explains how to connect to User Instance databases via other clients than the calling application..

regards

|||

Hi

Well, I followed the article closely and retrieved the pipe and ran the command "sqlcmd -S np:\\.\pipe\010E053B-3912-43\tsql\query" and I received the following error:

"HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired."

I enabled Remote Connections from Surface Area Controll, stoped the service, restarted it, and it gives me the same error. How can I connect to a User Instance with the SQL Server Management? I did not saw such option ...

Also I want to ask if there are some resources to learn for an absolute beginner SQL Server Express. Some recomandations would be nice.

|||

hi,

try the SQL Server Configuration Manager as well... there you can enable the desired nework protocol..

regards

|||

Check out the FAQ at the top of this forum, you will find instructions on connecting Management Studio to a User Instance.

Enabling remote connections is not required, particularly since User Instances only support local connections. If you bravely read through the entire error you got, you'll see that the problem you're having is a timeout. This is a particularly bad error message that gets throwen for basically every connection problem (hey, I wasn't here when they wrote it). The important bit is usually at the end in parenthasis.

In your case I'll bet your User Instance isn't started so you're timing out trying to connect. The FAQ explains the details of how to get this to work.

Mike

No comments:

Post a Comment