[RESOLVED] sql update statement help
hi,currently i want to update the sql data from the textbox amend data.
once i execute the sql query all the database will update to same value of textbox.i only want to update 1 row data from the textbox amended,not all the database field.please help.
Code:
sSQL = "Update SpcData set PartNo = '" & txtpartno.Text & "',Dimension ='" & txtdimension.Text & "',MachineNo = '" & txtmachineno.Text & "', Inspector = '" & Txtinspector.Text & "', Date ='" & txtdate.Text & "' ,Time = '" & txttime.Text & "',SampleNo ='" & txtsampleno.Text & "', Data = '" & txtdata.Text & "'"
conn.Execute sSQL
thanks.
Re: sql update statement help
To update one row add a where clause
Code:
Update tblName
Set Col = Value
Where Id = IdValue
Is this what you are looking for ?
Re: sql update statement help
yup, you should add a where condition so as to filter the records to be updated
Re: sql update statement help
Take a moment and go through our database FAQ section.
Re: sql update statement help
hei thank guys,the problem has been solved.