Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

how to use datagridview checkbox for updating datatable

$
0
0

hi to all,

i have a situation where on the Form

having Datagridview named "DGVemppayD"

and a Button named "btnupdate"

i have added Unbound column of checkbox in datagridview named = "confrim"

the use code to fill datagridview:

Dim Connection As New SqlConnection(CnString)
        Dim ds As New DataSet
        Dim sql As String = "Select studentID,students_name_I,fathers_name_I,BA_Isubject_I," _& "BA_Isubject_II,BA_Isubject_III,BA_Isubject_IV,BA_Isubject_V,admission_category_I," _& "admission_number_I," _& "admission_date_I,BA_I_ol_status From tblstudentsregistrationBA ORDER BY students_name_I"
        Dim da As SqlDataAdapter = New SqlDataAdapter(sql, Connection)
        ' Create new column of type: DataGridViewCheckBoxColumn
        ds.Clear()
        da.Fill(ds, "tblstudentsregistrationBA")
        DGVemppayD.DataSource = ds.Tables(0)
        DGVemppayD.Refresh()

now i just want to select multiple rows with the use of checkbox and the update the datatable column name

----------->"BA_I_ol_status"

i am not that much good in this but i want like this

"Update [tblstudentsregistrationBA] set [BA_I_ol_status]= 'OK' where [confrim] = checked

please help me for this

its urgent

thanks in advance


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>