L
Logger
Help,
I’m applying updates to a web application that used Web Form Designer
Generated Code. I’m using Visual Studio 2003. For some reason lines keep
dropping out of the code in the .aspx.vb code behind file. Here’s the 2
lines that keep dropping. I think since the 1st line drops where the m_oConn
is being assigned with the connection string it is being dropped everywhere
it is being used. This of course causes errors when the program tries to
call the stored procedure. The error is "connection propery object has not
been initialized". This happens on every form I go into and modify with
visual studio.
Below is a small sample of the code.
1. Me.m_oConn = New
System.Data.SqlClient.SqlConnection(clsUtil.GetConnString)
2. Me.SqlDeleteCommand1.Connection = Me.m_oConn
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
1st LINE IS ADDED HERE!!
Me.m_DADeals = New System.Data.SqlClient.SqlDataAdapter
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "[DEALS_DELETE]"
Me.SqlDeleteCommand1.CommandType =
System.Data.CommandType.StoredProcedure
2ND LINE IS ADDED HERE!!!!
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_DealId",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False,
CType(0, Byte), CType(0, Byte), "DealId",
System.Data.DataRowVersion.Original, Nothing))
Do you know why this is happening?
I’m applying updates to a web application that used Web Form Designer
Generated Code. I’m using Visual Studio 2003. For some reason lines keep
dropping out of the code in the .aspx.vb code behind file. Here’s the 2
lines that keep dropping. I think since the 1st line drops where the m_oConn
is being assigned with the connection string it is being dropped everywhere
it is being used. This of course causes errors when the program tries to
call the stored procedure. The error is "connection propery object has not
been initialized". This happens on every form I go into and modify with
visual studio.
Below is a small sample of the code.
1. Me.m_oConn = New
System.Data.SqlClient.SqlConnection(clsUtil.GetConnString)
2. Me.SqlDeleteCommand1.Connection = Me.m_oConn
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
1st LINE IS ADDED HERE!!
Me.m_DADeals = New System.Data.SqlClient.SqlDataAdapter
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "[DEALS_DELETE]"
Me.SqlDeleteCommand1.CommandType =
System.Data.CommandType.StoredProcedure
2ND LINE IS ADDED HERE!!!!
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_DealId",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False,
CType(0, Byte), CType(0, Byte), "DealId",
System.Data.DataRowVersion.Original, Nothing))
Do you know why this is happening?