How to databind to a mysql database in vs2005 using basic/ or c#

  • Thread starter Thread starter garyusenet
  • Start date Start date
G

garyusenet

Hello,

I know how to create a mysql database and open it in code.

I don't know how to databind to it.

i have a simple form with 5 controls text controls. I want to enter
text into the controls, and write this text to a corresponding column
in the mysql database.

how do i do this please?

Thanks,
Gary.
 
Hi,

You bind your controls to an IList , this interface is implemented by
DataSet , so one solution is fill your dataset ( by using DataAdapter.Fill )
and then just bind it to your control.
Another possibility is using the DataReader , if you are just displaying the
info and do not need to keep it in memory just the IDataReader
implementation, just remember to close it after you are done with it.
 
Back
Top