i am using visual studio 2010 with sql server 2008 as back end, i have a problem in displaying all the rows of a particular column in a textbox. i have tried this,
cmd.CommandText = "select article_no from main where name='" & TextBox1.Text & "'"
cmd.Connection = con
con.Open()
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
If dr.HasRows Then
dr.Read()
TextBox2.Text = dr.Item("article_no")
End If
con.Close()
But i am able to display only first row of the particular name which i enter in textbox1 instead i need to display all the rows which consist of the same name entered in textbox1 and should display in textbox2.
so please anyone help me wit hthe required logic.
thanks in advance