Connecting to a network Server

Hi,

I am trying to connect to a SQL server 2000, running on my network Server (Win 2003) from my client terminal.

I have cerated the Database in the Sql server with sufficient rights for the domain user.

I am using C#.net express to connect.

1. I have the option to choose the mdf file only and not the server.
2. When I browse to the MDF file (stored in my windows server) , It gives me an error

the *.mdf file is on a network path that is not supported for database files......

Is there any solution for this.

Thanks in Advance

[586 byte] By [AlaguThirunavirkarasu] at [2007-12-23]
# 1

I think this maybe by design although unsure as it is better in the long term to have the files stored locally for obvious reasons.

I guess you can attach the mdf files as a database in SQL then just access the database programmatically, or just copy the files across

how are you "browsing" to the file?

ahmedilyas at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 2

I wanted the database to reside in the server. Develop the application and upon deployment of this application to all my network clients, they must be able to access the database.

I expect the indivudual clients to update this database.
I would prefer define the connection string in the app.config with the server name so that all the clients in the network server can point to the server easily.

AlaguThirunavirkarasu at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 3

Why don't you just attach the mdf file to SQL Server? Once attached just create a connection string:

Data Source=Server;Initial Catalog=database;User Id=sa;Password=asdas;

or trusted security:

Server=Server;Database=database;Trusted_Connection=True;

ahmedilyas at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 4
While SQL server allows you to dynamically attach a database with the AttachDbFilename property in the connection string, the corresponding .mdf file *has* to reside on the same PC that hosts the SQL server instance. The path must reference a local disk, not a network share. That pretty much kills the option of keeping your app.config the same for the deployed vs the development version of your program...

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...