G
Guest
public void BindGrid()
{
SqlConnection myConnection = new
SqlConnection("Server=Server;database=MyDatabase;UID=xyz;PWD=123456;Trusted_Connection=Yes"); Or
and i tried with "Server=Server;database=MyDatabase;Trusted_Connection=Yes");
myConnection.Open();
SqlDataAdapter myCommand = new SqlDataAdapter("select * from dbo.table1",
myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "dbo.table1");
DataGrid1.DataSource=ds.Tables["dbo.table1"].DefaultView;
DataGrid1.DataBind();
myConnection.Close();
}
I get that error
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: Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection
i am running web on local and sql server on different server using sql
server 2005 with .net 2003 and windows pro with sp2
{
SqlConnection myConnection = new
SqlConnection("Server=Server;database=MyDatabase;UID=xyz;PWD=123456;Trusted_Connection=Yes"); Or
and i tried with "Server=Server;database=MyDatabase;Trusted_Connection=Yes");
myConnection.Open();
SqlDataAdapter myCommand = new SqlDataAdapter("select * from dbo.table1",
myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "dbo.table1");
DataGrid1.DataSource=ds.Tables["dbo.table1"].DefaultView;
DataGrid1.DataBind();
myConnection.Close();
}
I get that error
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: Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection
i am running web on local and sql server on different server using sql
server 2005 with .net 2003 and windows pro with sp2