asp.net - How to update particular record using update query in SQL Server with vb.net? -
i have query retrieve selected record in textbox ./..
how use query update record :
i want when enter sumit in textbox1 , click submit button record id 1 updated name sumit///
dim sqldata new system.data.sqlclient.sqlconnection("data source=.\sqlexpress;attachdbfilename=|datadirectory|\database.mdf;integrated security=true;user instance=true") dim cmdselect new system.data.sqlclient.sqlcommand("select top 1 name table1 order id desc", sqldata) sqldata.open() dim dtrreader system.data.sqlclient.sqldatareader = cmdselect.executereader() if dtrreader.hasrows while dtrreader.read() textbox1.text = dtrreader("name") end while else response.write("no customer found supplied id.") end if dtrreader.close() sqldata.close()
build sqlcommand commmandtext
update foo set customername = @customername id = @id
then add 2 parameters commmand values capture inputs , run after setting connection , opening it.
take @ page , through work done
Comments
Post a Comment