Lars Breiter

Hi,

I hope, I'm in the right Group. Everytime I want to add a Empty Database-file (*.mdf) I get the error, that I don't have the SQL Server Express installed. But it is installed and the Server is running. The option "Allow remote connections" is enabled.
In VB express I go to "Add -> New" and Database (*.mdf)
Please anyone

Thank you


Re: Visual Basic Express Edition Add SQL Database to project

Bruno J.C. Nunes

Click with the right button of your mouse on the project name in the solution explorer, then ADD --> NEW ITEM --> SQL Database




Re: Visual Basic Express Edition Add SQL Database to project

Ken Tucker

Try increasing the time out in the database tools section of Visual Studio Properties.




Re: Visual Basic Express Edition Add SQL Database to project

Lars Breiter

Bruno J.C. Nunes wrote:
Click with the right button of your mouse on the project name in the solution explorer, then ADD --> NEW ITEM --> SQL Database


That's excatly my Problem. Everytime I do that, I get the Error, there is no SQL Server installed and I should download it at http://go.microsoft.com/fwlink/ LinkID=49251. But it is installed and the SQL Server is working, because I have already designed a few other Databases.




Re: Visual Basic Express Edition Add SQL Database to project

Bruno Yu - MSFT

Lars Breiter,

As described in your question, I tried to connect to the SQL Server Express from my VB Express Edition with the Database Explore. In the Data Connections, when we choose Add Connection, there are only two kinds of data source: Access and SQL Server. When I choose the Data Provider for SQL Server, the next step is just to choose a mdf file. I tried to choose one of the mdf file in the path C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\, I got the same problem, too. That is because in the Advanced properties, the default Data Source is just like .\SQLEXPRESS.

However, when you choose to write the connection string in your code, then you can access the database normally. I suggest you to use the SqlConnection object but not the provider in your code, just give up the database connection wizard.

However, in Visual Studio 2005, everything gose fine. If you would like to use the VS 2005, that will be a good solution, too. :-)






Re: Visual Basic Express Edition Add SQL Database to project

Alexey Raga

I have the same problem. Any timeouts don't help.

I think VS2005 just cannot recognize that SQL Server Express is present on the local machine. SQL Browser is started, TCP/IP and NamedPipes are enabled...

I don't understand why but I always have an "Error 26" when try to "Add New Item -> Database.mdf". At the same time I can work normally in the server explorer.






Re: Visual Basic Express Edition Add SQL Database to project

Antonio Mertens

I have the same problem. I've search the net for every piece of information I could find and nothing.

I'll describe you what I've done so far:

I have to scenarios:

1) WinXP + Visual Studio 2005 + SQLServer Express 2005
2) WinXP + Visual Web Developer + SQLServer Express 2005

All the things below I've tried in both scenarios:

  • All services of SQLServer Express are running and active (SQLSERVER + BROWSER)
  • I've enabled remote connections allowing TCP and NamedPipes. (I've also tried with TCP Only option)
  • I've made telnet to SQL server and had no problems connecting
  • I can connect to SQL Server using SQL Management Studio Express
  • I can access SQL using the command line (sqlcmd)
  • I can access using integrated windows security and default user 'sa'

Situation:

  • In both scenarios if I use a connectionString in web.config or use the Server Explorer to create a connection to the SQLServer it is succefull and I can create/update/delete tables and records from the DB.
  • If I use VS ou VWD to create a new MDF file (Add New Item -> Database.mdf) I get the error 26 as described in the last post.
  • After reading the thread along with many others I've check the connection properties (using Advanced button in the 'Add Connection' window and check every configuration (including timeouts and server name)
  • I've tried reinstall both VS, VWD and SQLExpress and same problem occured.

Since I couldn't create a SQL file using VS or VWD I've downloaded and MDF file example and tried to connect but same error occured.

Is there anything I'm missing... I don't know much about SQL Server but in the last few days I've read alot about connection errors but none solved my problem.

(One more thing... Windows Firewall is disabled and I don't have any firewall and/or antivirus running)





Re: Visual Basic Express Edition Add SQL Database to project

JChilluffo

I'm having this same issue, but my situation is a bit different.

Running:

  • Vista
  • SQL Server 2005 Workgroup SP2
  • VS 2005 SP1 w/ Vista update
  • IIS 7

I can connect to sql server using management studio. I can connect to the aspnetdb using "Server=<servername>...." connection string. If I try to use the server instance .\MSSQLSERVER(to add an app specific DB) it says the connection string is invalid(yes, user instance is set to false). If I try to add a database within VS IDE I get the "SQL Server 2005 Express isn't installed" message. When browsing my web server I get this error:

System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

I've tried adding NETWORK SERVICE to the list of users in Management Studio and it's not there, only NT AUTHORITY\SYSTEM is available.

I'm running out of ideas..





Re: Visual Basic Express Edition Add SQL Database to project

Ivandelson

Did you try to run VS in Admin mode