I have a Field called 'worklog'. Each time the field is updated I want to add some text to the Beginning of the field before it is sent to the Database.
for example: The Text the User Typed in is
"Here is some sample text"
Text I want to update the data base with is
"Entry made on 7/3/2007 by John Smith: Here is some sample text"
In my code behind I'm using the SqlDataSource1_Updating sub to access the value of the text box using the FindControl method. I am able to add text to the string and display ALL the text in the trace log. However when I try to set the Defaultvalue of the SQL Paremeter that updates the database I only get the value that was originally in the text field and not the Contatenated text.
Can anybody tell me what I'm doing wrong?
Thanks in Advance for any assistance.
Mark Buckley
for example: The Text the User Typed in is
"Here is some sample text"
Text I want to update the data base with is
"Entry made on 7/3/2007 by John Smith: Here is some sample text"
In my code behind I'm using the SqlDataSource1_Updating sub to access the value of the text box using the FindControl method. I am able to add text to the string and display ALL the text in the trace log. However when I try to set the Defaultvalue of the SQL Paremeter that updates the database I only get the value that was originally in the text field and not the Contatenated text.
Code:
Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SqlDataSource1.Updating
Dim MyWorkLog As String = ""
Dim MyTempWorkLog As String = ""
MyTempWorkLog = CType(EditIncidentSummaryForm.FindControl("WorkLog"), TextBox).Text
MyWorkLog = "<b>Entry Made by:</b> " & Context.User.Identity.Name & "<br/>" & MyTempWorkLog
'Write the value of MyWorkLog to the TRACE LOG
Trace.Write(MyWorkLog.ToString) 'this works I get ALL the text
SqlDataSource1.UpdateParameters("WorkLog").DefaultValue = MyWorkLog.ToString
'The above does NOT work I only get the text from MyTempWorkLog
End Sub
Can anybody tell me what I'm doing wrong?
Thanks in Advance for any assistance.
Mark Buckley