确定你的空间有数据服务连接
源错误:
行 29: ConnectionStringSettings setting = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"];
行 30: myCon.ConnectionString = setting.ConnectionString;
行 31: myCon.Open();
行 32:
行 33: //2 使用SqlCommand提交查询命令
源文件: d:root3g1008688_comwebDefault2.aspx.cs 行: 31
这里你的文件没有上传到服务器,重新检查下数据库操作的文件有没有上传完整
Imports System.Data
Imports System.Data.SqlClient
Module 连接数据库
Public Server1 As String
Public DataBase1 As String
Public Function GetTable(ByVal sqlstr$) As DataTable
Dim SqlConn As SqlConnection = New SqlConnection("server=" & Server1 & ";database=" & DataBase1 & ";integrated security=true") '声明这些SQL的类
Dim facDataAdapter As SqlDataAdapter = New SqlDataAdapter
Dim SqlComm As SqlCommand = New SqlCommand(sqlstr, SqlConn)
facDataAdapter.SelectCommand = SqlComm
Dim dt As DataTable = New DataTable
facDataAdapter.Fill(dt)
Return dt
End Function
End Module
以上是如何使用VB将本地的SQL数据库传输到远程SQL的详细内容。更多信息请关注PHP中文网其他相关文章!