我为一个程序创建了代码来检查数据库中是否存在表。但它不断强调编码中的限制。错误 23“字符串”类型的值无法转换为“字符串的一维数组”你能告诉我我做错了什么并检查我的其余编码是否正确。
这是编码:
Dim cn As New SqlClient.SqlConnection(SQL_Loader("", My.Settings.SQL_Win_Auth, _
My.Settings.SQL_Username, My.Settings.SQL_Password, My.Settings.SQL_Server_Name, _
My.Settings.SQL_DB_Name))
Dim Cmd As New SqlClient.SqlCommand
Dim Reader As SqlClient.SqlDataReader
Cmd.Connection = cn
cn.Open()
Dim restrictions As String
restrictions = "Pastel_Companies"
Dim dbTbl As DataTable = cn.GetSchema("Pastel_Companies", restrictions)
If dbTbl.Rows.Count = 0 Then
MessageBox.Show("Table Does Not Exist")
Else
MessageBox.Show("Table exists")
End If
感谢您提供的任何帮助