Remote Connection While using Attached Database file in MssqlExpress 2005
-
Hi All, Kindly suggest me how i use same database file from different Computers. i am using mssql express 2005 with vb.net. thanks
rmshah Developer
Please try these steps : 1. Put the database file (*.mdf) in shared location, and give Full Control to users Who will use connection e.g. ASPNET user or any machine user in case of windows application. 2. Then use following connection string : SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=;Integrated Security=True;Connect Timeout=30;User Instance=True"); 3. Although this may not recommended solution, but It works.
dnpro "Very bad programmer"
-
Hi All, Kindly suggest me how i use same database file from different Computers. i am using mssql express 2005 with vb.net. thanks
rmshah Developer
You don't actually use same database file. You install SQL Server on a computer, place your database in the SQL Server and applications will connect to the SQL Server (not the database file) using SqlConnection. For connection refer to: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx[^]
The need to optimize rises from a bad design.My articles[^]