dejandejanovic
asked on
ComboBox won't populate by stored procedur with parameter. Need someone to check code.
Hello,
same as title question. I would be pleased if someone show me, why my code won't popualte combobox by sql stored procedure.
Thank you in advance for help.
same as title question. I would be pleased if someone show me, why my code won't popualte combobox by sql stored procedure.
Dim newAdapater As SqlDataAdapter
Dim tbl As New DataTable
Dim conProc As New SqlConnection
Dim cmdProc As New SqlCommand
conProc.ConnectionString = DB
conProc.Open()
cmdProc.Connection = conProc
cmdProc.CommandText = "GetState"
cmdProc.CommandType = Data.CommandType.StoredProcedure
cmdProc.Parameters.Add("IsoCodes", Data.SqlDbType.NVarChar, 500).Value = "US"
newAdapater = New SqlDataAdapter(cmdProc)
newAdapater.Fill(tbl)
Me.ComboBoxState.DataSource = tbl
Me.ComboBoxState.DisplayMember = "StateName"
Thank you in advance for help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Mistake was really dummy, so I would not comment.
Thanks for quick reply, and test on your site.