asp to asp.net conversion issues

J

John

Hi

I am trying to convert my asp app tp asp.net and I have a few issues;

1. I have the following code for a db connection;

onn = New ADODB.Connection
conn.Open("PROVIDER=SQLOLEDB;DATA
SOURCE=mysqlserver;UID=username;PWD=password;DATABASE=mydb")

I am getting a 'ADODB.Connection' is not defined.' error on the first line.
What is the fix for this?

2. I have a lot of Name xxxx is not declared. Do I need to define all these
variable?

Thanks

Regards
 
M

Mark Rae

I am trying to convert my asp app tp asp.net and I have a few issues;

1. I have the following code for a db connection;

onn = New ADODB.Connection
conn.Open("PROVIDER=SQLOLEDB;DATA
SOURCE=mysqlserver;UID=username;PWD=password;DATABASE=mydb")

I am getting a 'ADODB.Connection' is not defined.' error on the first
line. What is the fix for this?

The fix for this is to use ADO.NET, not ADO.
http://www.google.co.uk/search?hl=en&rls=GGLG,GGLG:2006-28,GGLG:en&q="ADO.NET"+tutorial&meta=
2. I have a lot of Name xxxx is not declared. Do I need to define all
these variable?

You certainly do! Ain't no VBScript no more...!

I'd suggest you get yourself a copy of this:
http://www.amazon.com/ASP-NET-Every...=pd_bbs_1/104-5740038-0751132?ie=UTF8&s=books

And read it from beginning to end before you do anything else...
 
J

Jason Kester

John said:
I am trying to convert my asp app tp asp.net and I have a few issues;

First off, if you have not yet done so, track down a copy of ReSharper.
I couldn't imagine trying to port from ASP to ASP.NET without it.
1. I have the following code for a db connection;

I am getting a 'ADODB.Connection' is not defined.' error on the first line.
What is the fix for this?


You have two options. The simple way to get your app up and running
(that will cripple you down the road) is to add a reference to the old
ADO library. In the project, under References, add a new reference and
dig around in the COM tab.

The real solution however, is to port your database stuff over to
ADO.NET. It's really not that hard (assuming you have ReSharper to
track down and fix your broken references. otherwise, next to
impossible), and will allow you to take advantage of all the cool
features for which you're porting to .NET in the first place.
2. I have a lot of Name xxxx is not declared. Do I need to define all these
variable?

Yes.


Good luck!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
M

Mark Rae

The real solution however, is to port your database stuff over to
ADO.NET. It's really not that hard (assuming you have ReSharper to
track down and fix your broken references. otherwise, next to
impossible)

???

Porting from ADO to ADO.NET without ReSharper is next to impossible...???

What utter, utter nonsense!!

IMO, ADO.NET is one of the least complex areas of the entire .NET Framework.
 
J

Jason Kester

Mark said:
Porting from ADO to ADO.NET without ReSharper is next to impossible...???

No. ASP, not ADO. Porting ASP to ASP.NET without ReSharper is
thoroughly no fun. In fact, C# development in general goes a lot
faster if you have the right tools. That's why I told the guy to make
sure his development environment was up to speed before tackling a
port.

But yeah, ADO.NET is nothing special. If you remove the ADODB from the
front of everything, it's essentially a matter of hitting alt+enter a
bunch of times while ReSharper hands you the correct library
references.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top