Dropping lines of code when modifying .aspx.vb with vs2003 ide.

Dropping lines of code when modifying .aspx.vb with vs2003 ide.

am 06.12.2007 22:54:03 von 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.
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?

Re: Dropping lines of code when modifying .aspx.vb with vs2003 ide.

am 07.12.2007 06:28:41 von notmyfirstname

Logger,

Is there no row as well that says that you should not change designer
created code. (This is probably one of the reasons the partially classes are
created so that people keep the desinger created code alive.

Cor