Как я могу сохранить данные из combobox в числовой столбец с помощью VB.NET а SQL server ?
i have tabel and search form with combobox when i click save button error hapened in this line dt_bank.Rows(pos_bank).Item("bank_user_id") = Val(CmbBank_user_id.SelectedValue) --------------------------------------------------------------------------------- this is code Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click dt_bank.Rows.Add() Dim pos_bank As Integer = Module2_bank.dt_bank.Rows.Count - 1 dt_bank.Rows(pos_bank).Item("bank_id") = Val(TxtBank_id.Text) dt_bank.Rows(pos_bank).Item("bank_name") = TxtBank_name.Text dt_bank.Rows(pos_bank).Item("bank_address") = TxtBank_address.Text dt_bank.Rows(pos_bank).Item("bank_branch") = Cmbbank_branch.Text dt_bank.Rows(pos_bank).Item("bank_account") = Txtbank_account.Text dt_bank.Rows(pos_bank).Item("bank_swiftcode") = Txtbank_swiftcode.Text dt_bank.Rows(pos_bank).Item("bank_phone") = TxtBank_phone.Text dt_bank.Rows(pos_bank).Item("bank_fax") = TxtBank_fax.Text dt_bank.Rows(pos_bank).Item("bank_email") = TxtBank_email.Text dt_bank.Rows(pos_bank).Item("bank_webpage") = TxtBank_webpage.Text dt_bank.Rows(pos_bank).Item("bank_note") = TxtBank_note.Text dt_bank.Rows(pos_bank).Item("bank_user_id") = Val(CmbBank_user_id.SelectedValue) dt_bank.Rows(pos_bank).Item("bank_date") = DtpBank_date.Value MessageBox.Show("تمت الاضافه بنجاح", "اضافة بنك", MessageBoxButtons.OK, MessageBoxIcon.Information) Module2_bank.save_bank() Module2_bank.load_bank() newbank() End Sub
Что я уже пробовал:
i use vb.net, sql server i try this Val(CmbBank_user_id.text) and Val(CmbBank_user_id.Selectedindex) and Val(CmbBank_user_id.Selecteditem) and Val(CmbBank_user_id.Selectedtext) and Val(CmbBank_user_id.SelectedValue)