Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Database Enum Types in Datagrid with Ability to Update DB table

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
Hi,

I have a mysql database with an enumerated type/column, the column is a varchar type and is limited to coupe, sedan, station_wagon. So when I edit a table cell in phpmyadmin for example it drops down and I have only those choices for the cell value.

In VS 2010 C# I have a datagridview of another table without the enumerated column just to initially test things out. With "select *" show the table in a form/datagrid. I also have it set up where I can edit this datagridview's cells and it will update the values in the mysql table.

What I want to do is show the user the mysql table with enumerated cols (and it also has some cols which are not enumerated too) in a datagridview and have a drop-down for the enum table cols in the datagrid where the user can select and also have the action of updating the actual mysql table.

How is this done? I can provide existing code if needed. Thanks.
 
You simply create manually the datagridview and use a DataGridViewComboBoxColumn binded to that column
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top