强烈要求同志们帮帮忙~~~
Server Error in '/WebApplication7' Application.
--------------------------------------------------------------------------------
The ConnectionString property has not been initialized.
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.InvalidOperationException: The ConnectionString property has not been initialized.
Source Error:
Line 208: Dim MyCommand As New System.Data.SqlClient.SqlCommand(DeleteCmd, MyConnection)
Line 209: MyCommand.Parameters.Add("@id", SqlDbType.NVarChar, 50).Value = DataGrid1.DataKeys(e.Item.ItemIndex)
Line 210: MyCommand.Connection.Open()
Line 211: Try
Line 212: MyCommand.ExecuteNonQuery()
Source File: c:\inetpub\wwwroot\WebApplication7\WebForm1.aspx.vb Line: 210
Stack Trace:
[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.SqlClient.SqlConnection.Open() +433
WebApplication7.WebForm1.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\WebApplication7\WebForm1.aspx.vb:210
System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +110
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +116
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573