Private SqlCESvrAgentUrl As String '运行 SQL Server Ce Server Agent的计算机的 Web 地址
Private RemoteSqlServerName As String '远程Sql Server 2000数据库服务器名称
Private RemoteConnString As String '连接远程Sql Server 2000的连接字符串
Private CurrentLogonUserID, CurrentLogonUserName As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LogOnRemoteHost(txtInternetUrl.Text, txtSqlServer.Text, txtUserID.Text, txtPassword.Text) Then
GetTaskListOfEMP_ID(txtUserID.Text)
MsgBox("验证成功。")
Else
MsgBox("验证失败,请核对员工ID号和密码,然后重新输入。")
End If
End Sub
Function LogOnRemoteHost(ByVal SqlAgentUrl As String, ByVal SqlServerName As String, ByVal EMPId As String, ByVal Password As String) As Boolean
Dim en As SqlCeEngine = Nothing
Dim rda As SqlCeRemoteDataAccess = Nothing
Dim connLocalUserInfo As SqlCeConnection = Nothing
Dim daLocalUserInfo As SqlCeDataAdapter = Nothing
Dim dtLocalUserInfo As DataTable = Nothing
If dtLocalUserInfo.Rows.Count > 0 Then '验证通过
CurrentLogonUserID = dtLocalUserInfo.Rows(0).Item("emp_id").ToString
CurrentLogonUserName = dtLocalUserInfo.Rows(0).Item("emp_name").ToString
Return True
Else '验证失败,返回false
Return False
End If
Catch e As SqlCeException
MsgBox(e.Message)
Return False
End Try
End Function
Function GetTaskListOfEMP_ID(ByVal EMPId As String) As DataTable
Dim en As SqlCeEngine = Nothing
Dim rda As SqlCeRemoteDataAccess = Nothing
Dim connLocalTask As SqlCeConnection = Nothing
Dim daLocalTask As SqlCeDataAdapter = Nothing
Dim dtLocalTask As DataTable = Nothing
Finally
' Dispose of the RemoteDataAccess object.
'
rda.Dispose()
End Try
End Function
下面还有一些程序写不下了~~~~~~~~~~~
出现如下错误
Internal error: HTTP header information is either corrupted or missing in the transport message. It could be a network transmission error or an IIS problem.
位于 System.Data.SqlServerCe.NativeMethods.CheckHRESULT()
位于 System.Data.SqlServerCe.SqlCeRemoteDataAccess.Pull()
求各们高手指教,这一个问题搞的我花了二周了,几乎快崩溃了,谢谢
It could be a network transmission error or an IIS problem.
可能是网络传输错误或者IIS问题。。。。。
1.IIS只要你能访问网页的话就应该没问题。。。
2.检查下你的数据库控件。不知道你用的是ADO还是什么的。。这个要检查下。。。
3.访问权限?这个也是个问题。。。是否有访问修改数据库的权限。
个人理解。仅供参考。