How do I update a single record from an spl server 2012 datatable using a c# datareader and a stored procedure? -
i need know how update single record sql server 2012 datatable using c# datareader , stored procedure. have stored procedure allows me update single record in datatable. can't figure out how use c# data reader update record in datatable. example, have female student in college class i'm teaching , gets married, need select record student info datatable , change last name new married name. in advance help.
a datareader
disconnected, read-only. that's why there aren't methods updating values.
you said have stored procedure updating. execute create sqlconnection
, sqlcommand
, add parameters when execute command generates sqldatareader
. instead of calling executereader()
typically call executenonquery()
. that's used executing query doesn't return results. returns number of updated rows.
Comments
Post a Comment