Last post Oct 30, 2018 11:59 AM by Konstantin Goldobin
Oct 29, 2018 09:28 AM|Konstantin Goldobin|LINK
I'm migrating a legacy ASP.Net 1.1/2.0 application from Microsoft Data Provider for Oracle to ODP.NET and have already encountered SQL statements that stopped working because of incorrect parameter binding. While I understand what I need to do about manually
written code, I'm completely lost when it comes to code generated by Visual Studio. There is a lot of declarations in *.ascx.cs files like:
etc. that are later used in InitializeComponent() methods in these files, which are commented as "Required method for Designer support - do not modify the contents of this method with the code editor."
When I open the corresponding *.ascx files, I see no mentioning of those OracleCommand objects, so I have no clue based on what this code was generated, where the SQL statements used by those OracleCommand objects come from,
and how their arguments are defined. So, could someone please give me some pointers as to how this code is generated and, most importantly, how I can change the BindByName property of all those auto-generated OracleCommand objects so that if the code gets
regenerated the change will remain or ensure that Parameters are added in the same order as they appear in the SQL statements?
BTW, such declarations and InitializeComponent() methods can be found in a couple of pure *.cs files that do not have any associated *.ascx or *.aspx files, which makes them even more puzzling...
Oct 30, 2018 05:19 AM|Ackerly Xu|LINK
Hi Konstantin Goldobin,
Here is a link about auto-generated code in visual studio, maybe you could consider Resharper.
In addition,this is a forum about asp.net(only have webform instead of winform.).
If it is not your case ,you could refer to winform's forum for help.
Oct 30, 2018 09:53 AM|Konstantin Goldobin|LINK
Thanks for your answer! I'm dealing with a web ASP.NET application, so I guess it means I'm dealing with webforms and this is a correct forum. This link you provided is about server-side controls that are placed on a page and the code generated for them
in code-behind files. My question is about code generation for things that I can't find any reference to in aspx/ascx files, like a bunch of OracleCommand objects. I also noticed that there are fields generated for other things that are not present on the
webforms, like OracleDataAdapter and DataSet objects and I guess it is all related, but what I cannot figure out is how these things were added to aspx/ascx pages, where I can find them when I open the aspx/ascx pages in Designer, and how I can customise them
for use with ODP.NET.
PS I've just noticed that my post was moved to this section by someone. I initially created it in the Getting Started section.
Oct 30, 2018 11:05 AM|DA924|LINK
I'm migrating a legacy ASP.Net 1.1/2.0 application from Microsoft Data Provider for Oracle to ODP.NET and have already encountered SQL statements that stopped working because of incorrect parameter binding. While I understand what I need to do about
manually written code, I'm completely lost when it comes to code generated by Visual Studio. There is a lot of declarations in *.ascx.cs files like
You are trying to come from .NET Framework 1.1 and 2.0 to a current .NET Framework technology doing some kind of migration? No, you should be doing a conversion, re-write of the entire solution, becuase you'll be facing a whole lot of problems IMO.
Oct 30, 2018 11:59 AM|Konstantin Goldobin|LINK
Thanks! For now I'm only moving it from MS data provider for Oracle to ODP.Net.