D
dord
I have a WebService which simply obtain data remotely from a PocketPC PDA
and store it in the database. The following codes are one of the functions
in my "service1.asmx". Each time I call it either from a PDA or ASPX page,
it can successfully do exactly what I want it to be. However, I just found
that each time I call it, the MSDE (i.e. the database engine) will become
stuck, the database can neither be restarted nor removed, and I used to
modify the database engine by a SQL script file, which will initially delete
the whole database. Besides this, everything is fine and the engine works
properly. And what I currently did for script modification is to restart the
computer.
Does anyone have similar experience and know the solution? Please help.
Thanks.
<WebMethod()> _
Public Function UploadScanRecord(ByVal sdata As SerialScanData) As
String
Dim SqlConnection1 As SqlConnection
Dim SqlCommand1 As New SqlCommand
Try
SqlConnection1 = New SqlConnection(DBString)
SqlCommand1.CommandText = "INSERT INTO [dbo].[InDetail]
(ItemNum, UBD, LotNum, TagID, ScanTime, RemoteDateCreate, Loc, Operator)
VALUES ('" & sdata.ItemNum & "','" & sdata.UBD & "','" & sdata.LotNum &
"','" & sdata.TagID & "','" & sdata.ScanTime & "','" & sdata.DateCreat &
"','" & sdata.Loc & "','" & sdata.Operator & "')"
SqlCommand1.Connection = sqlConnection1
SqlConnection1.Open()
SqlCommand1.ExecuteNonQuery()
SqlConnection1.Close()
Return "OK"
Catch ex As Exception
''ReportException(ex, sdata)
Return "ERROR " & ex.ToString
Finally
SqlCommand1.Dispose()
SqlConnection1.Dispose()
End Try
End Function
and store it in the database. The following codes are one of the functions
in my "service1.asmx". Each time I call it either from a PDA or ASPX page,
it can successfully do exactly what I want it to be. However, I just found
that each time I call it, the MSDE (i.e. the database engine) will become
stuck, the database can neither be restarted nor removed, and I used to
modify the database engine by a SQL script file, which will initially delete
the whole database. Besides this, everything is fine and the engine works
properly. And what I currently did for script modification is to restart the
computer.
Does anyone have similar experience and know the solution? Please help.
Thanks.
<WebMethod()> _
Public Function UploadScanRecord(ByVal sdata As SerialScanData) As
String
Dim SqlConnection1 As SqlConnection
Dim SqlCommand1 As New SqlCommand
Try
SqlConnection1 = New SqlConnection(DBString)
SqlCommand1.CommandText = "INSERT INTO [dbo].[InDetail]
(ItemNum, UBD, LotNum, TagID, ScanTime, RemoteDateCreate, Loc, Operator)
VALUES ('" & sdata.ItemNum & "','" & sdata.UBD & "','" & sdata.LotNum &
"','" & sdata.TagID & "','" & sdata.ScanTime & "','" & sdata.DateCreat &
"','" & sdata.Loc & "','" & sdata.Operator & "')"
SqlCommand1.Connection = sqlConnection1
SqlConnection1.Open()
SqlCommand1.ExecuteNonQuery()
SqlConnection1.Close()
Return "OK"
Catch ex As Exception
''ReportException(ex, sdata)
Return "ERROR " & ex.ToString
Finally
SqlCommand1.Dispose()
SqlConnection1.Dispose()
End Try
End Function