我有一个函数,它获取 3 个参数、一个文本框和 2 个组合框,并在代码中将它们用作 OleDbDataReader 的临时值,但我有一个问题并需要运行时
错误:没有为一个或多个必需参数提供值。
Sub load_txt_code(ByVal nkala As ComboBox, ByVal ckala As ComboBox, ByVal ghyemat As TextBox)
dr.Close()
cmd.Connection = con
cmd.CommandText = "select name_jens from ajnas where id = " & nkala.Text & ""
dr = cmd.ExecuteReader()
While dr.Read
nkala.Text = dr.Item(0)
End While
'por kardane combobox e gheymat
dr.Close()
cmd.CommandText = "select gheymate_forush from ajnas where id = " & ckala.Text & ""
dr = cmd.ExecuteReader()
While dr.Read
If Not IsDBNull(dr.Item(0)) Then
ghyemat.Text = dr.Item(0)
Else
ghyemat.Text = Nothing
End If
End While
End Sub