Some value in autoinc

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
DomenicoFormoso
Posts: 5
Joined: Sat 06 Oct 2018 14:42

Some value in autoinc

Post by DomenicoFormoso » Sat 06 Oct 2018 14:53

Hi I'm new to c # but I come from delphi.
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

Shalex
Site Admin
Posts: 8493
Joined: Thu 14 Aug 2008 12:44

Re: Some value in autoinc

Post by Shalex » Thu 11 Oct 2018 20:01

Please open your *.lqml model and check the following properties of ManufacturerId:
* Auto Generated Value
* Auto-Sync
* IdGenerator

Refer to https://www.devart.com/linqconnect/docs ... ation.html.

Does this help?

DomenicoFormoso
Posts: 5
Joined: Sat 06 Oct 2018 14:42

Re: Some value in autoinc

Post by DomenicoFormoso » Wed 28 Nov 2018 08:45

Thanks

Post Reply