By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,543 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,543 IT Pros & Developers. It's quick & easy.

DataSet insert method returns int in one case and object in another - why?

P: n/a
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

--
Alan Silver
(anything added below this line is nothing to do with me)
Aug 1 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.