Hi there,
ExecuteScalar return the first row's first column. The rest is ignored.
ExecuteNonQuery returns the number of records afected by your query.
You can insert the data because it is in a stored procedure, and I haven't
tested it, but maybe you could ExecuteScalar with an insert statement as
well with a select statement..
Best regards
Steven Lewis
"Dinesh" <(E-Mail Removed)> escribió en el mensaje
news:28CD733C-7D7A-4C0F-8D0F-(E-Mail Removed)...
> Hi,
> I have one stored procedure in SQL server in which i have written one
> insert statement. Now in my cs file i pass the parameters require to
> execute
> that stored procedure and finaly by mistaken I used command.ExecuteScalar
> instead of command.ExecuteNonQuery. Surprisingly i am able to insert the
> data
> in table. Can anyone please tell me how i am able to insert data using
> ExecuteScalar of SQLCommand class.
>
> Help is really appriciated.
>
> Thx in advance
|