1

I've tried to do my homework on this...

I'm migrating a site from classic asp to asp.net 4.0

Before I rework all the code, I wanted to get clarification that the way i think my database code should be updated is fairly correct. (I'm using SQLClient objects)

First, when old code would use forward only recordsets or access single record/value, I'm fairly sure i'd use SqlCommand and SqlDataReader. That is pretty straightforward.

Now, when my old code navigates a recordset (movePrevious, find, etc.)... I believe the way to go is with SqlDataAdapter and DataTable to retrieve the data and DataView to filter/find/navigate the data.

I'n looking to do a quick migration... i don't want to get too bogged down in the new entity framework... so - just trying to stick with similar objects/logic.

I know this is one of those questions that doesn't really have a right/wrong answer... and I think that is part of my problem in finding an answer - there are so many.

Thanks,

bill g

casperOne
  • 73,706
  • 19
  • 184
  • 253
bill g
  • 11
  • 1
  • Forget the quick migration, you going to rewrite many thinks. – Aristos Mar 15 '11 at 02:30
  • Was my answer good enough, bill g? I'm guessing it probably wasn't what you wanted to hear but I think it'd be a good opportunity for you to build on your skillset and build something maintainable in the long run. – Fellmeister Mar 24 '11 at 03:46
  • well - the key to my question is 'quick migration.' I have no intention _at this time_ to redesign the thing. So - I'm updating the code to be compliant - pretty much line by line. What I am working from is (my own) poorly written app full of sql and recordsets. Anyway, my goal is to move this monster to asp.net (to resolve some speed issues) and then redesign/rewrite. So - I just want verify the parallels in .net 4 to recordsets. – bill g Mar 27 '11 at 05:56
  • Why do you think this is the solution to speed issues? Also, if you want to move from ASP to .Net and you WANT to do a line by line port - move to WebMatrix WebPages approach. You get C# compiling, you keep the mix of html and server side code the same. You don't need to use WebMatrix, you can use visual studio. – Brian White Jun 22 '12 at 03:51

2 Answers2

1

I answered something similar here.

You only really need to know about the database bit here. For you it's a really good point to start as you mean to go on.

It terms of how deal with the data returned, it's up to you. I'd recommend custom class style dataset approach which will make life easier in the long run but of course in the short term, you'll have to generate them all which can be made easier by CodeSmith*. That in itself has an upfront cost but will, again, save time in the long run.

*Other code generation tools are available.

Community
  • 1
  • 1
Fellmeister
  • 591
  • 3
  • 24
0

If your main issue is the database I propose to move and learn the Subsonic 2 (not subsonic 3, too slow) or any other DAL.

See here some examples: http://subsonicproject.com/docs/Main_Page

Take some time to understand it, make some tests, see what really do, after wille you can't do with out it, but you need some time to understand the logic, and setup it to your project.

Get this project to play with and see some dal in action, ready to run.

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150