How to Connect remoter computer i am getting exception error for remote as well as local computer
-
the following code for backup a database stadard form of zip file. it is working properly for c# with windows app but not C# with asp. why i don't know. in c# with windows also one problem it is not connecting to remote server database. using System.Data.SqlClient; using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using SQLDMO; using System.IO; using System.Diagnostics; using Shell32; using System.Xml; using System.Security.Permissions; using System.Configuration; namespace backup1 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.TextBox TextBox2; protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI.WebControls.Label Label3; protected System.Web.UI.WebControls.Label Label4; protected System.Web.UI.WebControls.Button Button2; protected System.Web.UI.WebControls.TextBox t1; protected System.Web.UI.WebControls.TextBox t2; protected System.Web.UI.WebControls.ListBox ListBox1; protected System.Web.UI.WebControls.ListBox lb; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { /*SQLDMO.Application oSQLServerDMOApp = new SQLDMO.Application(); SQLDMO.NameList oNameList; oNameList = oSQLServerDMOApp.ListAvailableSQLServers(); for (int intIndex = 0; intIndex <= oNameList.Count - 1; intIndex++) { if (oNameList.Item(intIndex as object) != null) { lb.Items.Add(oNameList.Item(intIndex).ToString()); } } if (lb.Items.Count > 0) lb.SelectedIndex = 0; else lb.Items.Add("(local)");*/ } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { thi