Hi, i'm having a porb on how to select the data from database and display in the textbox. i had use the sql like this to select the data:
Public Function displayEditMsg(ByVal userName As String, ByVal strname As String) As Dataset
Dim ds As New DataSet
Dim da As New SqlDataAdapter("SELECT msg, Member.userName, Member.dt FROM msg, Member WHERE msg.username = '" & strname & "'AND Member.userName = msg.userName", cn)
cn.Open()
da.Fill(ds)
cn.Close()
Return ds
End Function
I use this code to display the datas in the textbox:
Dim userName As String
Dim strname As String = user_name.Text
tb_msg.Text = bl.displayEditMsg(userName, strname).ToString
Can anyone help me with it? With these codes, the datas can't be display.
thankx
tiffany
Public Function displayEditMsg(ByVal userName As String, ByVal strname As String) As Dataset
Dim ds As New DataSet
Dim da As New SqlDataAdapter("SELECT msg, Member.userName, Member.dt FROM msg, Member WHERE msg.username = '" & strname & "'AND Member.userName = msg.userName", cn)
cn.Open()
da.Fill(ds)
cn.Close()
Return ds
End Function
I use this code to display the datas in the textbox:
Dim userName As String
Dim strname As String = user_name.Text
tb_msg.Text = bl.displayEditMsg(userName, strname).ToString
Can anyone help me with it? With these codes, the datas can't be display.
thankx
tiffany