L
Lance Geeck
I am new to .NET and SQL Server and thought maybe someone could point out
what I am doing wrong here.
My problem is I can't figure out why this doesn't update the database. I am
calling this web services that in turn should write a row to the database.
**** Begin Code ********
<WebMethod()> _
Public Function AddStatusRecord(ByVal BName As String, _
ByVal StatusNote As String, ByVal ContactName As String) As Boolean
Try
Dim dRow As DataRow
Dim dsStatus1 As New dsStatus
dRow = dsStatus1.Tables("StatusLog").NewRow
dRow.Item("BName") = BName
dRow.Item("StatusNotes") = StatusNote
dRow.Item("ContactName") = ContactName
dRow.Item("DateStamp") = Now.utcNow
'tried many variations on this including
' Now.ToString, Now.ToLocalTime, Now.Now
dRow.EndEdit()
adtStatus.Update(dsStatus1, "StatusLog")
Return True
Catch ex As Exception
Return (False)
End Try
End Function
**** End Code *********
******* Table Description *******
BName char 50
ContactName char 50
DateStamp datetime 8
StatusNotes char 255
The primary key is BName, ContactName and DateStamp. Nulls are not allowed
in any column.
I don't seem to be catching an exception on this. For some reason it isn't
writing a row into the database.
Any suggestions?
Thanks
Lance
what I am doing wrong here.
My problem is I can't figure out why this doesn't update the database. I am
calling this web services that in turn should write a row to the database.
**** Begin Code ********
<WebMethod()> _
Public Function AddStatusRecord(ByVal BName As String, _
ByVal StatusNote As String, ByVal ContactName As String) As Boolean
Try
Dim dRow As DataRow
Dim dsStatus1 As New dsStatus
dRow = dsStatus1.Tables("StatusLog").NewRow
dRow.Item("BName") = BName
dRow.Item("StatusNotes") = StatusNote
dRow.Item("ContactName") = ContactName
dRow.Item("DateStamp") = Now.utcNow
'tried many variations on this including
' Now.ToString, Now.ToLocalTime, Now.Now
dRow.EndEdit()
adtStatus.Update(dsStatus1, "StatusLog")
Return True
Catch ex As Exception
Return (False)
End Try
End Function
**** End Code *********
******* Table Description *******
BName char 50
ContactName char 50
DateStamp datetime 8
StatusNotes char 255
The primary key is BName, ContactName and DateStamp. Nulls are not allowed
in any column.
I don't seem to be catching an exception on this. For some reason it isn't
writing a row into the database.
Any suggestions?
Thanks
Lance