...

View Full Version : issue converting to ASP.NET framework 4.0



FabriceB
01-11-2011, 09:16 PM
Hi!

I've been asked in my work place to complete a transition from ASP to ASP.NET. I am new to ASP.NET so this may very well be something simple that I just had no idea about. In either case, thanks for even looking at this.

Ok, that said, as mentioned, most of the reports we offer are in ASP but we had some existing reports in ASP.NET (2 of them more specifically).

So far what i've done is to first install the latest framework (4) on my system. From there, the issues began. The 2 application that use to run on my localhost no longer run.

To be as specific as I can, note that these 2 applications work just fine if I revert back to the 2.0 framework. :confused:

I get the following error message:


Overload resolution failed because no accessible 'parameters' accepts this number of arguments.

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.MissingMemberException: Overload resolution failed because no accessible 'parameters' accepts this number of arguments.

Source Error:

Line 68: cmd.parameters.Add(New OleDbParameter())
Line 69: cmd.parameters.Add(New OleDbParameter())
Line 70: cmd.parameters(0).Value = "LOGON"
Line 71: cmd.parameters(1).Value = session("lan_id")
Line 72: cmd.parameters(2).Value = Session("SQLSession")

Source File: D:\zzzz_localdev\auth\basic.aspx Line: 70


I made a search on google for "New OleDbParameter" since I am unfamiliar with it and most of what I came accross had OleDbParameter() with the parameter being passed. Am I wrong to see this as the issue since the values for each parameters are precised afterword (as shown in line 70 and onwards)? (maybe there is a change from 2.0 to 4.0 which prevents the format of these statements of being used?)

Thanks in advance!

Fab

pigpen
01-12-2011, 10:22 PM
Just looking at the MSDN for OleDbParameter, it doesn't look it changed from 2.0 and 4.0.

4.0
http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbparameter.aspx

2.0
http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbparameter(v=VS.80).aspx

Does it work on ASP.NET 3.5?

You could also try asking on the ASP.NET forums. If you find an answer, post back as I'm curious, too.

FabriceB
01-13-2011, 05:31 PM
Does it work on ASP.NET 3.5?


Good question!

I made the jump directly to 4! I'll try it out a little later and keep you posted. I also posted this up on MSDN' .Net forum so we'll see if I get any answers!

Thanks for the help!

FabriceB
01-21-2011, 09:53 PM
If you find an answer, post back as I'm curious, too.

so here is what seems to have worked for me:


cmd.Parameters.Add(New OleDbParameter())
cmd.Parameters.Add(New OleDbParameter())
cmd.Parameters.Add(New OleDbParameter())
cmd.Parameters.item(0).Value = "LOGON"
cmd.Parameters.item(1).Value = Session("lan_id")
cmd.Parameters.item(2).Value = Session("SQLSession")

It still doesn't tell me why the previous didn't work but at this point, I need to move forward and catch up on the rest of the task!

thanks for the help!

FabriceB
01-21-2011, 09:57 PM
can u tell me why these error came

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>


Have you found the answer to your question?

If not, for one you would be better off making your own thread, for two you may need to give more details...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum