Hi, I'm having a problem on updating the value to database from textbox. Initally, there is a textbox for display the retrieve valur from database. This textbox can be edit and update to the database. However, when this textbox has something retrieve and display it can't update to database. If this textbox didn't not retrieve anything from database and just do a update method it is susscessful.
this is my codes, can anyone help me to look at it? thank.
'this is the data layer page.
Public Function updateReply(ByVal strmsg As String, ByVal strname As String, ByVal strtopic As String, ByVal strSubcat As String, ByVal msID As Integer, ByVal uID As String, ByVal tID As Integer, ByVal dt As DateTime) As DataSet
Dim ds As New DataSet
Dim da As New SqlDataAdapter("UPDATE msg SET msg = '" + "%" + strmsg + "%" + "' WHERE topic = '" & strtopic & "'AND subCat = '" & strSubcat & "' AND msgID = '" & msID & "' AND userID = '" & uID & "'AND topicID LIKE '" & tID & "'AND datTim = '" & dt & "'", cn)
cn.Open()
da.Fill(ds)
cn.Close()
Return ds
End Function
'this is the presentation page
Dim strmsg As String = tb_msg.Text
Dim strname As String = lb_name.Text
Dim strtopic As String = lb_topic.Text
Dim strSubcat As String = lk_subCat.Text
Dim mID As Integer
Dim usID As String
Dim tID As Integer
Dim msdt As DateTime
mID = Session("msgID")
usID = Session("usID")
tID = Session("toID")
msdt = Session("md")
ds = bl.updateReply(strmsg, strname, strtopic, strSubcat, mID, usID, tID, msdt)
thankx. tiffany
this is my codes, can anyone help me to look at it? thank.
'this is the data layer page.
Public Function updateReply(ByVal strmsg As String, ByVal strname As String, ByVal strtopic As String, ByVal strSubcat As String, ByVal msID As Integer, ByVal uID As String, ByVal tID As Integer, ByVal dt As DateTime) As DataSet
Dim ds As New DataSet
Dim da As New SqlDataAdapter("UPDATE msg SET msg = '" + "%" + strmsg + "%" + "' WHERE topic = '" & strtopic & "'AND subCat = '" & strSubcat & "' AND msgID = '" & msID & "' AND userID = '" & uID & "'AND topicID LIKE '" & tID & "'AND datTim = '" & dt & "'", cn)
cn.Open()
da.Fill(ds)
cn.Close()
Return ds
End Function
'this is the presentation page
Dim strmsg As String = tb_msg.Text
Dim strname As String = lb_name.Text
Dim strtopic As String = lb_topic.Text
Dim strSubcat As String = lk_subCat.Text
Dim mID As Integer
Dim usID As String
Dim tID As Integer
Dim msdt As DateTime
mID = Session("msgID")
usID = Session("usID")
tID = Session("toID")
msdt = Session("md")
ds = bl.updateReply(strmsg, strname, strtopic, strSubcat, mID, usID, tID, msdt)
thankx. tiffany