Forum Moderators: open

Message Too Old, No Replies

ASP -> ASP.Net Transition

Does everyone find it painful

         

IanTurner

7:33 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Everything we do in ASP seems to take twice as much code to do in ASP.Net

Useful string functions seemed to have been removed and database query handling is just so cumbersome as to be almost unusable.

It also seems like you have to everything in a convoluted manner.

Its like microsoft took the worst bits of ASP (that **** global.asa file and its ilk) and built a whole new framework about them.

(Guess who's been having a bad day with .Net sites today)

korkus2000

7:46 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use to feel the same way. I had the old MS mindset. You have to use .Net like it is open source. You need to use classes that are ready to use. It will speed up your development 100 times. Have you been using the starter kit classes?
[asp.net...]

They have so many complex classes. The sql server stuff makes DB integration take no time at all.

TheNige

7:50 pm on Mar 12, 2004 (gmt 0)

10+ Year Member



I can't share your pain. Pain for me is going back to old ASP apps and having to touch them. I could see that .Net was more superior since the first day I tried it.

woop01

8:29 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been there. I just got done moving about 200 ASP code intensive pages to ASP.NET. To make it worse, they were ASP pages with FP borders who I had to do the layout as well.

However, it was WELL worth it for just a few of the new features in ASP.NET. I can't begin to describe how much the cache object alone has helped.

IanTurner

8:34 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I'm that worried about development time, though its always nice to save some. Raw performance issues are our main concern.

I like those starter kits, we may well be able to use some of them in our developments.

The difficulty we had is that we effectively have their equivalents for standard ASP, lots of standard code segments, db connectors, error trappers, input validators and the like. Each of our attempts to do the same with dotnet seems to have ended up with more code and worse performance. (p.s. we never used the global.asa file for ASP development, it also seemed very cumbersome.)

txbakers

10:50 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm with you Ian, I'm slowly learning .NET but what I've seen and tried hasn't been exciting.

Of course, years of experience with ASP will make it seem so much easier than learning something new.

IanTurner

11:54 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Its almost as if there were a number of ways of developing in ASP, and the way MS was intending was very code intensive and those who chose alternatives have been short changed with the introduction of .Net

At the moment it just seems another push towards Open Source, PHP MySQL etc.

TheNige

12:16 am on Mar 13, 2004 (gmt 0)

10+ Year Member



IanTurner: can you give an example of how you think it is worse now...like an example of ASP vs ASP.Net database query handling.

duckhunter

1:17 am on Mar 13, 2004 (gmt 0)

10+ Year Member



It definitely takes more time and effort at the planning stage but well worth it. The functionality you can plug in and out is incredible. With .NET there is ALWAYS more than one way to do something and usually about 5.

Take the time to try the different options out, dig in for a few months and write a project or two but definitely get some form of training, even if it's a video because there are huge (emphasize HUGE) pitfalls to scalability and stability if you do things the wrong way. Used as it's intended, which is completely different from classic ASP, it's more horsepower and functionality than you can find anywhere.

I used to be afraid of it, now I couldn't live without it.

You need to use classes that are ready to use

There are over 64000 methods and subroutines MS has exposed through the CLR. Everything I used to have to write my own functions for in the past are now exposed for our use. Basically, this is all the stuff that Windows uses to run but you get to utilize it.

IanTurner

1:31 am on Mar 13, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



ASP.Net DB Connection

Connect = New OleDbConnection
Adapter = New OleDbDataAdapter
ClassyDS = New DataSet
SelectStatement = "Stored Procedure "
ConnectString = ConfigurationSettings.AppSettings("ConnStr")
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = New OleDbCommand(selectStatement,Connect)
Adapter.SelectCommand.Connection.Open
Adapter.Fill(ClassyDS, "ShoppingBasket")

ASP DB Connection

set objConn = Server.CreateObject ("ADODB.Connection")
connString = "DRIVER={SQL Server};SERVER=****.****.****.xxx;UID=uid;PWD=pwd;DATABASE=dbname"
objConn.Open connString
strExec = "StoredProcedure"
Set RSData = TMConn.Execute(strExec)

In the second example we just include everything execpt the strExec line

TheNige

3:54 am on Mar 13, 2004 (gmt 0)

10+ Year Member



IanTurner:

Try something like this:

Dim Connect As New SqlConnection(ConfigurationSettings.AppSettings("ConnStr"))
Dim Adapter As New SqlDataAdapter("Stored Procedure", Connect)
Dim ClassyDS As New DataSet
objConn.Open()
Adapter.Fill(ClassyDS, "ShoppingBasket")

There are many overloads for the methods and functions in the .Net libraries so these things could be done in dozens of ways.

Also, just curious, in your ASP.Net example you are using OLEDBConnection, and in your ASP.Classic expample you are using a SQL Server connection string. If you are using SQL Server with your .Net app you should try to use the System.Data.SQLClient libraries as they are optimized for use with SQL Server.

plumsauce

4:58 am on Mar 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



edit:
sorry, brain fumble

duckhunter

1:23 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



TheNige has it. Another way is the SqlDataReader that puts your data in a Recordset like old ADO instead of a Dataset. Instead of a Do while not EOF use While rs.read...

Dim DBConn As New SqlConnection(ConnectString)
DBConn.Open()
Dim objCommand As New SqlCommand(selectStatement or stored procedure name,DBConn)
Dim objReader As SqlDataReader
objCommand.CommandType = CommandType.StoredProcedure
objReader = objCommand.ExecuteReader()

While objReader.Read
'Do your work.......
End While

If you want inline SQL instead of Stored Proc..
objCommand.CommandType = CommandType.Text