Coding Table Adapter in ASP.NET

Posted on 2009-04-28
Last Modified: 2012-05-06
I am using ASP.NET + VB, and a MySQL DB to develop a web application.
I would like to create Table Adapter to bound object data source and Grid view to the adapters.
I want for the adapter typically to have a select, update, and delete method....
But i cannot use the designer to do so, (as if the application was using a SQL Server Epress DB),
So i guess i need to write the code for the adpaters....

Can someone please tell me how i can proceed:
A sample code of the adapter.
A method to follow
BTW :What is the adapter should be a function in a class?...
thanks a lot
Question by:Nyana22
    LVL 14

    Accepted Solution


    The advantage of using designer is it will create all the native functions along with correct datatype for all the columns including setting up null values, function to check nulls, etc..

    For creating Table Adapters using code, you have to manually create all the commands i.e. SelectCommand, InsertCommand, UpdateCommand and DeleteCommand and pass the parameters for all the Command Parameters.
    LVL 53

    Assisted Solution

    Datasets and Data Adapters in C# .NET

    Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0
    LVL 53

    Expert Comment


    Author Comment

    but i am using a MySQL database,
    When i create a new table adapter in the designer i cannot connect to the database, i cannot see the connection string...
    However it's in the web.config file!
    Can i use the designer with a MySQL DB?
    LVL 14

    Expert Comment


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now