嗨,我是 VB 平台的新手,谁能帮我理解最后几行代码,这里我最后用粗体突出显示,这对我来说是不理解或困惑的。该显示成员和值编号有什么作用?
.. cmbcust是组合框...
客户表具有以下字段的位置。
**Customer_sname** **Customer_code** **Customer_fname**
nokia 1 nokia corp.
samsung 2 samsung corp.
sony 3 sony corp.
Micromax 4 Micromax India corp.
通过custval的是诺基亚、三星、索尼
Public Function customfunc(ByVal custval As String) As DataSet
Try
Dim strSQL As String = "select * from customer where cust_sname in (" & custval & ")"
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Adap As New SqlDataAdapter(strSQL, Conn)
Dim Ds As New DataSet
Adap.Fill(Ds, "customer")
ReadINICustomers = Ds
Catch EXP As Exception
MsgBox("Error Connecting to Server :" & EXP.Message, MsgBoxStyle.Critical)
End Try
End Function
Public Sub Fillcustomer()
Dim Lstcust() As String
Dim Lstcust1 As String
Lstcust1 = ""
Lstcust1 = custINIval
Dim Ds As New DataSet
Ds = objData.ReadINICustomers(Lstcust1)
cmbcust.DataSource = Ds.Tables("customer")
cmbcust.DisplayMember = Ds.Tables("customer").Columns.Item("cust_sname").ToString().Trim()
cmbcust.ValueMember = Ds.Tables("customer").Columns.Item("cust_code").ToString().Trim()
End Sub
cmbcust.DisplayMember = Ds.Tables("customer").Columns.Item("cust_sname").ToString().Trim() cmbcust.ValueMember = Ds.Tables("customer").Columns.Item("cust_code") .ToString().Trim()