Hai....
Im new to .net ,I need help in doing my project....
If i Give the lastname in textbox then the items in lastname should be displayed in the anthor textbox
For ex :
Thomus,123,aaa
Thomus,345,bbb
H_alert,456,ccc
If i enter thomus it should show all thomus from my database but its not working...only one item is displaying in the textbox....
fro ex:
thomus,123,aaa
I set textbox mode as multiple line
please help me ...what to do...
i used this code its showing only one item....
mycon.Open()
Dim myCmd As New SqlCommand
myCmd.CommandText = "SELECT * FROM agent where Lastname='" & Me.TextBox2.Text.Trim() & "'"
myCmd.Connection = mycon
Dim i As Integer
Try
Dim y As SqlDataReader
y = myCmd.ExecuteReader()
i = 0
While y.Read
TextBox9.Text = (y.GetValue(1) & vbCrLf & y.GetValue(3) & vbCrLf & y.GetValue(2))
End While
y.Close()
Catch ex As Exception
Label1.Text = ex.Message
Finally
mycon.Close()
myCmd.Dispose()
End Try
thanks in advance...
:(