This is my code in Update Command
cmdupdate.CommandText = ("update personinfo set SurName = ['" & DataGridView1.Item("SurName", i).Value.ToString & "'],FirstName = ['" & DataGridView1.Item("Firstname", i).Value.ToString & "'],MiddleName = ['" & DataGridView1.Item("Middlename", i).Value.ToString & "'],Present_CurrentAddress = ['" & DataGridView1.Item("Present_CurrentAddress", i).Value.ToString & "'],ProvincialAddress = ['" & DataGridView1.Item("ProvincialAddress", i).Value.ToString & "'],Noofchildren = ['" & DataGridView1.Item("Noofchildren", i).Value.ToString & "'],Height = ['" & DataGridView1.Item("Height", i).Value.ToString & "'],weight = ['" & DataGridView1.Item("Weight", i).Value.ToString & "'],birthdate = ['" & DataGridView1.Item("birthdate", i).Value.ToString & "'],age = ['" & DataGridView1.Item("age", i).Value.ToString & "'],birthplace = ['" & DataGridView1.Item("birthplace", i).Value.ToString & "'],gender = ['" & DataGridView1.Item("gender", i).Value.ToString & "'],civilstatus = ['" & DataGridView1.Item("civilstatus", i).Value.ToString & "'],educationalattain = ['" & DataGridView1.Item("educationalattain", i).Value.ToString & "'],schoolname = ['" & DataGridView1.Item("schoolname", i).Value.ToString & "'],course = ['" & DataGridView1.Item("course", i).Value.ToString & "'],yearsofstudy = ['" & DataGridView1.Item("yearsofstudy", i).Value.ToString & "'],collegestatus = ['" & DataGridView1.Item("collegestatus", i).Value.ToString & "'],trainingschoolname = ['" & DataGridView1.Item("trainingschoolname", i).Value.ToString & "'],positiontrained = ['" & DataGridView1.Item("positiontrained", i).Value.ToString & "'],yearstrained = ['" & DataGridView1.Item("yearstrained", i).Value.ToString & "'],coursetrained = ['" & DataGridView1.Item("coursetrained", i).Value.ToString & "'],detachment = ['" & DataGridView1.Item("detachment", i).Value.ToString & "'],Region = ['" & DataGridView1.Item("Region", i).Value.ToString & "'],effdate = = ['" & DataGridView1.Item("effdate", i).Value.ToString & "'],workstatus = ['" & DataGridView1.Item("workstatus", i).Value.ToString & "'],empnumber = ['" & DataGridView1.Item("empnumber", i).Value.ToString & "'],positionemployed = ['" & DataGridView1.Item("positionemployed", i).Value.ToString & "'],yearsofemployed = ['" & DataGridView1.Item("yearsofemployed", i).Value.ToString & "'],sssnumber = ['" & DataGridView1.Item("sssnumber", i).Value.ToString & "'],tinnumber = ['" & DataGridView1.Item("tinnumber", i).Value.ToString & "'],nbi = ['" & DataGridView1.Item("nbi", i).Value.ToString & "'],nbidate = ['" & DataGridView1.Item("nbidate", i).Value.ToString & "'],pnp = ['" & DataGridView1.Item("pnp", i).Value.ToString & "'],pnpdate = ['" & DataGridView1.Item("pnpdate", i).Value.ToString & "'],priorexp = ['" & DataGridView1.Item("priorexp", i).Value.ToString & "'],gdexp = ['" & DataGridView1.Item("gdexp", i).Value.ToString & "'],guardposition = ['" & DataGridView1.Item("guardposition", i).Value.ToString & "'],uniformdate = ['" & DataGridView1.Item("uniformdate", i).Value.ToString & "'],millitary = ['" & DataGridView1.Item("millitary", i).Value.ToString & "'],LOS = ['" & DataGridView1.Item("LOS", i).Value.ToString & "'],previousemp = ['" & DataGridView1.Item("previousemp", i).Value.ToString & "'],licno = ['" & DataGridView1.Item("licno", i).Value.ToString & "'],licdate = ['" & DataGridView1.Item("licdate", i).Value.ToString & "'],licexp = ['" & DataGridView1.Item("licexp", i).Value.ToString & "'],dateofemp = ['" & DataGridView1.Item("dateofemp", i).Value.ToString & "'],badgeno = ['" & DataGridView1.Item("badgeno", i).Value.ToString & "'],neurocenter ['" & DataGridView1.Item("neurocenter", i).Value.ToString & "'],neuroresult = ['" & DataGridView1.Item("neuroresult", i).Value.ToString & "'],neurodate = ['" & DataGridView1.Item("neurodate", i).Value.ToString & "'],drugcenter = ['" & DataGridView1.Item("drugcenter", i).Value.ToString & "'],marijuana = ['" & DataGridView1.Item("marijuana", i).Value.ToString & "'],shabu = ['" & DataGridView1.Item("shabu", i).Value.ToString & "'],drugresult = ['" & DataGridView1.Item("drugresult", i).Value.ToString & "'],histories = ['" & DataGridView1.Item("histories", i).Value.ToString & "'] where surname = '" & DataGridView1.SelectedRows.ToString & "'")
im trying to update a data straight through the datagridview but sytax error in update command pls healp me.