[size=2][color=#0000ff]Dim[/color][/size][size=2] cmdSelect [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlCommand
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] reader [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlDataReader
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] conn [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlConnection = [/size][size=2][color=#0000ff]New[/color][/size][size=2] SqlConnection([/size][size=2][color=#800000]"Data Source=.\SQLEXPRESS;AttachDbFilename=|"[/color][/size][size=2] _
& [/size][size=2][color=#800000]"DataDirectory|\Procedures.mdf;Integrated Security=True;User Instance=True"[/color][/size][size=2])
conn.Open()
cmdSelect = [/size][size=2][color=#0000ff]New[/color][/size][size=2] SqlCommand([/size][size=2][color=#800000]"sp_selectZoneTimes "[/color][/size][size=2], conn)
cmdSelect.CommandType = CommandType.StoredProcedure
cmdSelect.Parameters.Add([/size][size=2][color=#0000ff]New[/color][/size][size=2] SqlParameter([/size][size=2][color=#800000]"@ZoneID"[/color][/size][size=2], SqlDbType.Int, 4))
cmdSelect.Parameters([/size][size=2][color=#800000]"@ZoneID"[/color][/size][size=2]).Value = CodeClass.GetZoneId([/size][size=2][color=#0000ff]CInt[/color][/size][size=2](TextBoxCustNo.Text)) [/size][size=2][color=#008000]'calls GetZoneID function to return the customers zone
[/color][/size][size=2]reader = cmdSelect.ExecuteReader()
[/size][size=2][color=#0000ff]While[/color][/size][size=2] reader.Read
[/size][size=2]DropDownListSlotID.Items.Add(reader([/size][size=2][color=#800000]"Time"[/color][/size][size=2]))
[/size][size=2][color=#0000ff]
[/color][/size][size=2][/size][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]While
[/color][/size]