none
Is there "behind the scenes" work done by ADO.net in asp.net applications? RRS feed

  • Question

  • I tried to post a similar question in the asp.net forum. I didn't get an answer, so I am hoping to find someone that might be able in this forum.

     

    I have just started working with databases using asp.net.  I had previously written a few console apps that wrote to and read from a database. When I did these I had to explicitly use ADO.net. I hand coded the datasets, data adapters, and data readers.

     

    I am wondering if there is ado.net components or  objects that are automatically generated when an asp.net app is built or compiled.  I am guessing this would be done for datagrids and dataviews...etc.  I have been looking at several of these apps and don't see much code that is for ADO.net. Is this correct?  How does ado.net wor in these types of situations?

     

    -thanks to anyone that can help

    Thursday, April 10, 2008 11:10 AM

Answers

  • ADO.NET work in Asp.net is not behind the scene because you use it to pass data between your pages and your database.  What you do depends on the control you are using on your page and what tasks you are performing on the page.  That is the reason Asp.net development require some planning before development because some controls are not suited for certain tasks and many controls require work around solutions.  Start with the link below and post again if you still need help.

     

    http://www.asp.net/learn/data-access/

     

    Thursday, April 10, 2008 2:40 PM

All replies

  • ADO.NET work in Asp.net is not behind the scene because you use it to pass data between your pages and your database.  What you do depends on the control you are using on your page and what tasks you are performing on the page.  That is the reason Asp.net development require some planning before development because some controls are not suited for certain tasks and many controls require work around solutions.  Start with the link below and post again if you still need help.

     

    http://www.asp.net/learn/data-access/

     

    Thursday, April 10, 2008 2:40 PM
  • If you use ADO.NET classes directly from your code, nothing additional generated in ASP.NEt and it works exact same way as it would be in any other application type, including console applications. You might use some data bound controls that provide some functionality based on ADO.NET and those components could generate additional code in behind to provide wrapping ADO.NET functionality.

     

    Friday, April 11, 2008 2:32 AM
    Moderator
  • (The TableAdapter can expose two types of methods: Fill methods that are suitable for filling an existing DataSet, and Get methods that return an already filled DataTable object. The former is more suitable for a Windows client (where the DataSet is kept in memory for the lifetime of the application), whereas the latter Get methods are more suitable for ObjectDataSource. The TableAdapter wizard can also automatically generate Update, Insert, and Delete methods for your provided SQL select statements (requires the primary key to be selected). After completing the wizard, Visual Studio adds a new DataTable and TableAdapter type to the DataSet designer.)

     


    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/objects.aspx#dal

     


    It is not what is generated but rather ADO.NET classes used, the above text is from this link ADO.NET use in Windows Client is not the same as Asp.net application and I am not aware of console like operation in Asp.net.

     

    Friday, April 11, 2008 2:30 PM
  • Here is how it works.

     

    You can use ADO.Net code pretty much anywhere.  You can use it in a console app, a WinForm or in ASP.Net pages (server side).  It is tricky to get the ADO.NET code to run on the client browser however,most folks avoid this and only send HTML to client to improve inter-operability with all the various client browsers.

     

    Programming in ASP.NET is a bit tricky because you want all the code to run on the server side but you want to present a rich UI to client that lets the client modify data, etc...

     

    ASP.NET has some controls that layer over ADO.NET that make programming easier, you should look at these and see how they can help you.

     

    I have not done any ASP.NET programming in ages so please ask around some more I may be a bit off base here but I think I summed up the basics.

     

     

     

    Monday, April 14, 2008 6:11 PM