mafila
یک شنبه 25 آذر 1386, 15:59 عصر
سلام
من می خواهم در #c به sql2000 متصل شوم .ولی با error زیر مواجه می شوم
کد برنامه :
privatevoid Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
SqlConnection sqlcon=new SqlConnection("server=(local); database=data3; user id=sa; password=1; ");
string str="select * from tab3";
SqlDataAdapter da=new SqlDataAdapter(str,sqlcon);
DataSet ds=new DataSet();
da.Fill(ds);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
}
errpor:
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 29: DataSet ds=new DataSet();Line 30: Line 31: da.Fill(ds);Line 32: Line 33: DataGrid1.DataSource=ds;
من می خواهم در #c به sql2000 متصل شوم .ولی با error زیر مواجه می شوم
کد برنامه :
privatevoid Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
SqlConnection sqlcon=new SqlConnection("server=(local); database=data3; user id=sa; password=1; ");
string str="select * from tab3";
SqlDataAdapter da=new SqlDataAdapter(str,sqlcon);
DataSet ds=new DataSet();
da.Fill(ds);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
}
errpor:
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 29: DataSet ds=new DataSet();Line 30: Line 31: da.Fill(ds);Line 32: Line 33: DataGrid1.DataSource=ds;