2
Reply

Connect to a remote database

malendrah

malendrah

Jan 13 2005 7:22 AM
6.7k
Hi I have a database on my computer( msde ) . All I want to do is connect to that Db and enter some data from another pc. When I use it on my pc it works but from another pc it fails. They are on the same network and can see each other. The error message is SQL server does not exist or acess is denied This is my code //------------------------------------------------------------ ---------------------------------- try { string connectionString = "Initial Catalog=Northwind;Data Source=blackie;Integrated Security=SSPI;"; SqlConnection myConnection = new SqlConnection(connectionString); myConnection.Open(); if( myConnection.Database.Length > 0 ) { MessageBox.Show( "Db Open" , "Open" ); } } catch( Exception ex ) { MessageBox.Show( "Db Closed" + ex.Message , "Closed" ); } //------------------------------------------------------------ ---------------------------------- Also should I be using a OleDbConnection for this . I am using mix mode for security thanks

Answers (2)