From: Family Tree Mike on
On 1/12/2010 6:20 AM, suresh songire wrote:
> Hi Sir
> I have the problem with my event function "SelecteIndexChanged" when i selected combobox item in this item database fetch then fill the no.of textbox in match submited values.
>
> i m code also write but ,one value match to every combo selected item
>
> Private Sub cmbCtime_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbCtime.SelectedIndexChanged
> Dim qry As String
> Dim con As New connection
> Dim ds As DataSet
>
> qry = "Select * from COMPLOTT where Time_id='"& cmbTime.SelectedValue& "'"
> ds = con.selectQuery(qry)
> If ds.Tables(0).Rows.Count> 0 Then
> txtc1.Text = ds.Tables(0).Rows(0).Item("CL_1")
> txtc2.Text = ds.Tables(0).Rows(0).Item("CL_2")
> txtc3.Text = ds.Tables(0).Rows(0).Item("CL_3")
> txtc4.Text = ds.Tables(0).Rows(0).Item("CL_4")
> txtc5.Text = ds.Tables(0).Rows(0).Item("CL_5")
> txtc6.Text = ds.Tables(0).Rows(0).Item("CL_6")
> txtc7.Text = ds.Tables(0).Rows(0).Item("CL_7")
> txtc8.Text = ds.Tables(0).Rows(0).Item("CL_8")
> txtc9.Text = ds.Tables(0).Rows(0).Item("CL_9")
> txtc10.Text = ds.Tables(0).Rows(0).Item("CL_10")
> End If
> End Sub
> pls anser me fastly
>
> Thanks so mach
>
>
> From http://www.google.co.in/url?sa=t&source=web&ct=res&cd=2&ved=0CA0QFjAB&url=http://www.developmentnow.com/groups/post.aspx?newsgroupid=38&threadid=245355&rct=j&q=how+to+fetch+data+on+the+selected+indexedchange++event+combobox+in+vb.net&ei=91dMS6TZF47u7API7v38Cw&usg=AFQjCNFGt8Zck345guPRjC-bRWzHMgbyNw
>
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com/g/

1. You need to tell us what is not behaving as you expect. Your text is
very hard to understand. In particular: "i m code also write but ,one
value match to every combo selected item".
2. Your code seems to be missing a creation of a connection object.
3. Your routine looks like it handles cmbCtime (a combobox) selected
index changed event. You reference cmbTime in our SQL statement. Those
are two different variables.
4. Put Option Strict On at the top of your code.

--
Mike
 | 
Pages: 1
Prev: Help on Dinstinct - Linq
Next: Help with code