views:

363

answers:

1

I have an ASP.Net form and i would like to save it into a database any ideas??

+2  A: 

Your best bet is to read up on ORMs like NHibernate. If you use that with a code generator like myGeneration, then you can easily not have to worry about the 'harder' parts of Data Access.

An Object relational mapper essentially does all of the hard work for you -- you use the code generator, point it to your database, and then it generates (most of) the data access code you'd need to get to your data. At that point, you write functions to Save() or Update() your objects, without worrying about the data access that's going on behind the scenes. To give you an idea, before I knew about DAL (Data Access Layers), I used NHibernate and hand crafted the XML needed to communicate with the database. Later on, I found out about myGeneration and used that. Still, it saved me from having to write SQL statements to access the data from my database. For generic CRUD operations, an ORM usually can't be beat.

If you end up wanting to do it the 'hard way', then you'll need to read up on how Datasets work in .NET, and more specifically, the concept of Database Driven Applications in .NET. Unfortunately, there's no way for us to 'plz send teh codez' without a much finer understanding of what specific data you are looking to pull from what form, and how your database is structured.

George Stocker