S
Shirley Flook
I am trying to learn C# and am getting totally lost. I am following through
the Microsoft 'Developing Web Applications' book, and have got to a bit
about Storing and Retrieving info with ADO.NET. (p.234 if anyone has this
book!).
I can connect to my training server to get the database up, and follow the
instructions to create a Dataset. Ithen have to put the following code in
the page_ load event:
//Fill the data set.
sqlAdapter1.Fill(DataSet1);
//Update the DataGrid.
dataGrid1.Databind();
When I run the application it always comes up in error. One error is that
the 'dataGrid' should have a capital D. Why when I have been told to type
it in as d?
Also I get this, which I can not make head nor tail of:
Server Error in '/mcsdwebapps/Chapter05/databases/AGAIN' Application.
--------------------------------------------------------------------------------
Login failed for user 'sa'.
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
'sa'.
Source Error:
Line 30: {
Line 31: //Fill the data set.
Line 32: sqlDataAdapter1.Fill(DataSet1);
Line 33: //Update the DataGrid.
Line 34: dataGrid1.DataBind();
Source File:
c:\inetpub\wwwroot\mcsdwebapps\chapter05\databases\again\designmode.aspx.cs
Line: 32
Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
AGAIN.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\mcsdwebapps\chapter05\databases\again\designmode.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
What does it mean? What am I doing wrong?
Iwould be really grateful if someone could help me please.
Thanks in anticipation
Shirley
the Microsoft 'Developing Web Applications' book, and have got to a bit
about Storing and Retrieving info with ADO.NET. (p.234 if anyone has this
book!).
I can connect to my training server to get the database up, and follow the
instructions to create a Dataset. Ithen have to put the following code in
the page_ load event:
//Fill the data set.
sqlAdapter1.Fill(DataSet1);
//Update the DataGrid.
dataGrid1.Databind();
When I run the application it always comes up in error. One error is that
the 'dataGrid' should have a capital D. Why when I have been told to type
it in as d?
Also I get this, which I can not make head nor tail of:
Server Error in '/mcsdwebapps/Chapter05/databases/AGAIN' Application.
--------------------------------------------------------------------------------
Login failed for user 'sa'.
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
'sa'.
Source Error:
Line 30: {
Line 31: //Fill the data set.
Line 32: sqlDataAdapter1.Fill(DataSet1);
Line 33: //Update the DataGrid.
Line 34: dataGrid1.DataBind();
Source File:
c:\inetpub\wwwroot\mcsdwebapps\chapter05\databases\again\designmode.aspx.cs
Line: 32
Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
AGAIN.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\mcsdwebapps\chapter05\databases\again\designmode.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
What does it mean? What am I doing wrong?
Iwould be really grateful if someone could help me please.
Thanks in anticipation
Shirley