Do I need to also install SQL server express?
Main Topics
Browse All TopicsIs there a way to connect to a remote Microsoft SQL database from Microsoft Visual C# 2008 Express?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Example:
Provider=sqloledb;Data Source=myServerAddress;Ini
myServerAddressm would be the IP of the server.
myDataBase would be the name of the database on the server.
myUsername and myPassword would be the user account in the database server.
SQL Server Express is a stand-alone alternative to a full blown SQL Server. It's usually used for development and for deployment with stand-alone database driven applications.
There are some limited database tools in Visual Studio, but you might want to install SQL Server Management Studio if you want to manage the database.
There isn't really any difference between a local connection and an external connection, you always specify the server to use.
Do you mean that the connection is locked to only connect to localhost?
If you mean that there is no external servers to choose from in the dropdown list, that's because it can only browse the servers in the same local network. For an external server you just type in the name.
I installed Visual Studio C# 2008 Express with SQL compact edition.
I couldn't connect to a remote database (didn't see an option)---or didn't know where on my remote server the sql database file was located---so I installed Microsoft SQL server express 2005. This didn't change anything.
Please help.
When I choose "Connect to Database" and then " Microsoft SQL Server Database File" with the data provider automatically selected as the ".NET Framework data provider for SQL Server" ---The description shows that this only allows to connect to a local SQL database.
The only other 2 options are to connect to SQL compact databases. Please help.
> I couldn't connect to a remote database (didn't see an option)
There is no special option for a remote connection. The connection is the same, it's just the server name that differs.
> or didn't know where on my remote server the sql database file was located
When you connect to SQL Server, you don't connect to a database file, you connect to the server and specify the name of the database.
If you get the option to select a database file, you have selected a connection for an SQL Server database file (SQL Express) instead of a connection for an SQL Server database (or just went with the default connection type). Change the "data source" to SQL Server, and you should get the option to choose/enter the server name/ip.
What is it that you are trying to connect to, really? Is it an SQL Server database server, or is it an SQL Express database file located in a folder on a different server?
If you connect to an SQL Server, you don't specify any file path, you only specify the server and the name of the datbase. The server can for example be an IP address like "192.168.1.42" and the database name can for example be "MyLittleDatabase".
Yes, that changes everything. By default it's not possible to connect to a datbase file on a network share.
It's possible to bypass this, but not recommended:
http://support.microsoft.c
It looks like Visual C# Express does not support adding database connections using the SQL Server data source, only using SQL Server Database File. But this is just an IDE limitation, you still can change have a connection string to a database server instead of a database file.
Here are some helpful info.
"The Visual Studio Express versions don't support anything else than Access and Sql Express database file. This is only a designer limitation. You can write code that connects to any database on the same computer or remote. You use a SqlConnection with a connection string, so changing the connection string should do the trick."
Source: http://forums.msdn.microso
"The VS Express products were designed to use User Instance connections so that you don't have to worry about many of the security consideration involved with SQL Server."
Source: http://forums.microsoft.co
I found a way to get add a SQL Server connection in Visual C# Express. Basically I used Visual Web Developer Express to add the connection (VWD doesn't have this limitation as in VC# Express), then I copied an AppData file (in which VS Express keeps this info) from VWD Express to VC# Express.
Details:
1. Download a copy of VWD Express.
2. Add a connection to your database on SQL Server using VWD (this is the part not available in VC# Express).
3. Copy the file "DefaultView.SEView" from the VWD Express AppData dir in "C:\Users\{username}\AppDa
4. That's it, the connections you added in VWD will be available in VC#.
Business Accounts
Answer for Membership
by: GreenGhostPosted on 2007-12-11 at 14:02:52ID: 20453282
Yes, of course. You just specify the IP or name of the server server.
gs.com
Here you can find examples of connections strings to use:
http://www.connectionstrin
You most likely will use SQL Server authentication (not trusted connection authentication), so the server has to be configured to accept SQL Server authentication. By default this is disabled.