this is my code.
Dim con As New SqlConnection()
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True"
Dim da As New SqlDataAdapter("select * from BSIT", con)
Dim table As New DataTable()
comboBox1.DataSource = New BindingSource(table, Nothing)
ComboBox1.DisplayMember = "BSIT"
ComboBox1.ValueMember = "Bernard"
dim con as new sqlconnection("connection string")
dim cmd as new sqlcommand
cmd.commandtext="insert into table1 (field1) values ("& combobox1.text &")"
you can use this code at any button click event to save the value of combo in db and also at selected index change event of your grid .
in place of text you can use the selectedvalue .tostring .
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...