A
Alan Silver
Hello,
I am using DataSets to insert data into a database. I have one that has
an insert method whose SQL looks something like...
insert into mytable (f1, f2) values (@f1, @f2);
select SCOPE_IDENTITY();
I call this from the code like this...
mytableTableAdapters.mytableTableAdapter mytableAdapter = new
mytableTableAdapters.mytableTableAdapter();
string newid = mytableAdapter.InsertStuff("fvalue1", "fvalue2");
and this works fine. The newid variable gets the latest identity ID from
the table.
I have another DataSet, set up in exactly the same way, that returns an
object. Try as I might, I cannot work out why it insists on returning an
object instead of a string (or other scalar). I have compared the two
and they seem to be similar.
Anyone any ideas? TIA
I am using DataSets to insert data into a database. I have one that has
an insert method whose SQL looks something like...
insert into mytable (f1, f2) values (@f1, @f2);
select SCOPE_IDENTITY();
I call this from the code like this...
mytableTableAdapters.mytableTableAdapter mytableAdapter = new
mytableTableAdapters.mytableTableAdapter();
string newid = mytableAdapter.InsertStuff("fvalue1", "fvalue2");
and this works fine. The newid variable gets the latest identity ID from
the table.
I have another DataSet, set up in exactly the same way, that returns an
object. Try as I might, I cannot work out why it insists on returning an
object instead of a string (or other scalar). I have compared the two
and they seem to be similar.
Anyone any ideas? TIA