Link to home
Start Free TrialLog in
Avatar of preserver3
preserver3

asked on

MySQL Adapter Update question

I'm using the byteFX derived ASP.NET compliant MySQL components in Visual Studio 2003 to talk to several tables including a coupt of joined tables.  My problem is in updating data and how to form the command text of the Update command for my adapter.  My Select command for instance, is easy
SELECT * FROM table_01t

My Inser Statement is easy

INSERT INTO table_01t (x,y,z) VALUES (Stringx,Stringy,Stringz)

where Stringx, Stringy and Stringz are derived from javascript based controls on a web page and then passed as string to the C# code on the server side.

My update gets tricky, and i'm not certain how to make my update command work properly... The adapter apparently wants it in this form MySQLAdaptert01.Update(DataSet,Tablename); and then somehow uses the update command I've included to update the datatable.  My problem is in generating the update command on the fly so I can update the right table, the right fields and from the right dataset based upon the users inputs.  I'm just not comfortable building the update string when I can't see how it will be used.

I have three tables with 75 columns aggregate(ie 21, 26, 28), and in the worst case scenario, I'd update every field in every table except for the ID strings of each, and in the simplest situation, i'd only be changing 1 field, in one column, in one table.
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of preserver3
preserver3

ASKER

MySql.Data.MySqlClient.MySqlCommandBuilder Table_01CommandBuilder = new MySql.Data.MySqlClient.MySqlCommandBuilder(Table_01Adapter,true);

is the command builder native to the MySQL .Net connector and works faster and more reliably than the ole or the odbc.

Thanks, you lead me in the right direction.



sorry, i have not used it and can not say that

B..M
mmarinov