How do I save a web form to a MySQL database?

I have an ASP.Net form and I would like to store it in the database any ideas

+1


source to share


1 answer


Your best bet is to read ORM like NHibernate . If you use this with a code generator like myGeneration then you easily don't have to worry about the "more complicated" parts of data access.

An object relational mapper essentially does all the hard work for you - you use a code generator, point it to your database, and then generate (most of) the data access code that you need to retrieve the data. At this point, you write functions for the Save () or Update () objects without worrying about the data access that happens behind the scenes. To give you an idea, before I learned about DAL (Data Access Layers), I used NHibernate and manually processed the XML needed to communicate with the database. Later I found out about myGeneration and used that. However, it saved me the trouble of writing SQL statements to access data from my database. For general CRUD operations, ORMs usually cannot be broken down.



If you end up wanting to do it the hard way, you will need to read How Datasets work in .NET, more specifically, the concept of a database driven application in .NET . Unfortunately, we cannot "translate the code" without a finer understanding of what specific data you want to extract from which form and how your database is structured.

+2


source







All Articles