As I am very new to VB.Net I need the solution of this problem as I have a database called LoanData which have 6 columns namely (EmployeeID,L6501,L6502,L6503,L6504,L6505) and i have two text boxes namely txtEmpID and TxtAmount and one ComboBox namely CmbLoanHead.
I want that when i select one of the head via ComboBox then the amount will be added to the specific column my database LoanData which head is selected in ComboBox.
for Example when I selected the head (L6502) in ComboBox then the amount of txtAmount whill be inserted in column (L6502) of LoanData Database, not in all columns or any other column....
My programing language is VB.Net...
What I have tried:
Private Sub BtnAddBPSWiseDeduct_Click(sender As Object, e As EventArgs) Handles BtnAddBPSWiseDeduct.Click
Cmd = New SqlCommand
Cmd.Connection = Con
Cmd.CommandText = "Insert into Loans_Data_Table(EmployeeID,L6501,L6502,L6503,L6504,L6505) values(@EmployeeID,@L6501,@L6502,@L6503,@L6504,@L6505)"
Cmd.Parameters.AddWithValue("@EmployeeID", TxtEmpID.Text)
Cmd.Parameters.AddWithValue("@L6501,@L6502,@L6503,@L6504,@L6505", TxtLoanAmount.Text = CmbLoanType.SelectedText)
Con.Open()
Cmd.ExecuteNonQuery()
Con.Close()
End Sub