BGREX.BGREXDataTable _bRexDataTable = new BGREX.BGREXDataTable();
BGREX.BGREXRow bgRexRow = _bRexDataTable.NewBGREXRow();
bgRexRow.BGRes_TITLE = "abc";
bgRexRow.BGRes_VERSION = 123;
_bRexDataTable.AddBGREXRow(bgRexRow);
int rewEffected = Adapter.Update(_bRexDataTable);
Have beed using above to insert record in Database, workes perfect. Now I need the id (Primary key) of newly inserted record which is auto generated, instead of rows effected to be returned from
Adapter.Update(_bRexDataTable);
It looks like I need SCOPE_IDENTITY() function, but I am not sure where to include this in designer as designers is not happy with following syntax added to the actual insert query. It woks fine in sqlserver Management console though
DECLARE @ROWI_D int
INSERT INTO TABLE
.....
.....
.....
VALUES
("val1","val2",.......................)
SET ROW_ID = SCOPE_IDENTITY()