Updating data in gridview


Line 64: //updating the record Line 65: Sql Command cmd = new Sql Command("Update Products set Product Name='" Product Name. Text "', Product Price='" Product Price "' where Product ID='" userid "'", conn); Line 66: cmd. Close(); Line 68: //Setting the Edit Index property to -1 to cancel the Edit mode in Gridview Sql Command cmd = new Sql Command("Update Products set Product Name='" Product Name. First I populated the datagridview by data of sqlserver 2008 database table, now i have muliple rows in datagridview containing data, i am trying to update any row but, in the database table it replaces other rows data by the row data that iam trying to update the code for update statement is given below Plz help me Dim cmd As New Sql Command("Update Employee Detail Set Salary = '" & dgv Emp Detail. The comment section of a question/answer is only meant for relevant information regarding the actual post at hand, like mistakes, requests for more details, etc.

updating data in gridview-12

Updating data in gridview

Dim DBCONSRT, QRYSTR As String Dim str SQL As String Dim DBCON, my Conn, my Command, rs As Object Dim No Of Records As Long rs = Create Object("ADODB.

Recordset") Const DB_CONNECT_STRING = "Provider=MSDASQL.1; Persist Security Info=False; User ID=cpa5k; Data Source=NP1; DSN=NP1; UID=cpa5k; PASSWORD=pass; SDSN=Default; HST=ibslnpb1.sysplex.homedepot.com; PRT=4101; Initial Catalog=QA1MM;" my Conn = Create Object("ADODB.

Count - 1 Dim cmd As New Sql Command("Update Employee Detail Set Salary = '" & dgv Emp Detail.

Dim dt = CType(Session("Task Table"), Data Table) 'Update the values.

Close() Next Protected Sub Page_Load() If Not Page. Dim task Table As New Data Table("Task List") ' Create the columns. Bind Data() End Sub Protected Sub Task Grid View_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) 'Retrieve the table from the session object.