I'm turning my software from delphi to c #, instead of MyDac I use dotConnect mysql.
My job today is to force a value on an autoinc column.
MyDac was good at doing this while dotConnect does not do it.
MyDac (work fine insert new row with manifaturer_id=150)
Code: Select all
...
Q:=TmyQuery.Create(Owner);
Q.Connection:=ecomm;
id:=150;
Q.SQL.Text:='INSERT INTO manufacturer (manufacturer_id, ....) VALUES '+'('+StrToInt(id)+',..
Q.ExecSQL;
Q.Close;
....
dotConnect (work but insert new row with manifaturer_id = nextvalue)
Code: Select all
...
OC dbx = new OC;
Manufacturer mani = new Manufacturer();
int id = 150;
mani.ManufacturerId = id;
dbx.Manufacturers.InsertOnSubmit(mani);
dbx.SubmitChanges();
...
Thanks