how can i connect Remote sql server i written code like this following
-
public void Backup() { SQLServer2Class server = new SQLServer2Class(); Databases databases; Database2 database; Backup2Class backup = new Backup2Class(); server.LoginSecure = true; server.Connect("192.168.1.145" , "ad" , "ad123"); //the above ip address is my remote computer ip address and ad is username, ad123 is password of remotecomputer. //i gave userid and password then also it is not working showing exception access is denied databases = server.Databases; string database1="pubs"; database = (Database2) databases.Item(database1, null); backup.PercentCompleteNotification = 1; backup.Database = database.Name; SaveFileDialog saveFileDialog1=new SaveFileDialog(); saveFileDialog1.ShowDialog();
this is haneef
-
public void Backup() { SQLServer2Class server = new SQLServer2Class(); Databases databases; Database2 database; Backup2Class backup = new Backup2Class(); server.LoginSecure = true; server.Connect("192.168.1.145" , "ad" , "ad123"); //the above ip address is my remote computer ip address and ad is username, ad123 is password of remotecomputer. //i gave userid and password then also it is not working showing exception access is denied databases = server.Databases; string database1="pubs"; database = (Database2) databases.Item(database1, null); backup.PercentCompleteNotification = 1; backup.Database = database.Name; SaveFileDialog saveFileDialog1=new SaveFileDialog(); saveFileDialog1.ShowDialog();
this is haneef
have u added the remote sql server in ur list of sql servers availabel over the network. I dont know if I'm using the rt word for it but anyway. it's shown in the enterprise manager right atthe same level where u see the node for ur local server. I may be wrong but I think u'll get this eror as long as u dont register that. hope it helps Rocky