![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a gridview "new" command that insert a new row into a postgresql database.that uses the odbc driver. Newbie as I am i thought that iReturn would have the new index that was created. SqlDS1.InsertCommand = "INSERT INTO \"Algorithms\" (source_code_id, comment VALUES (69, 'haleys comet', 1)"; int iResult = SqlDS_Algorithms.Insert(); Ok, instead of getting back an id I got back a "1" which just indicates the command ran ok. Looking at the database I see the new id value and it is 318. Is there some mechanism I can use to obtain the index value that was autogenerated? googleing around I see where some people are writing stored procedures and I see one here: http://www.thescripts.com/forum/thread173510.html Was just wondering if the is a way to use the gridview or sqldataset1 control to get that index value and avoid writing a stored procedure. |
#3
| |||
| |||
|
|
int iResult = SqlDS_Algorithms.Insert(); Ok, instead of getting back an id I got back a "1" which just indicates the command ran ok. Looking at the database I see the new id value and it is 318. Is there some mechanism I can use to obtain the index value that was autogenerated? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |