[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 915
  • Last Modified:

Coding Table Adapter in ASP.NET

Hello,
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
0
Nyana22
Asked:
Nyana22
  • 2
  • 2
2 Solutions
 
GiftsonDJohnCommented:
Hi,

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.
0
 
DhaestCommented:
Datasets and Data Adapters in C# .NET
http://www.homeandlearn.co.uk/csharp/csharp_s12p5.html

Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0
http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspx
0
 
Nyana22Author Commented:
Ok,
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?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now