0
我無法使用VB刪除SQL 2008 R2 Express表。這裏是我的代碼:VB.net SQL表刪除 - 表不會丟失
Private Sub Form10_AssyWIP_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim sqConQC As New SqlClient.SqlConnection("Server=QCG11\SQLEXPRESS;Database=QCGMAIN; Trusted_Connection=True;")
Dim sqCmdQC As New SqlClient.SqlCommand
sqCmdQC.Connection = sqConQC 'create the DB connection
sqConQC.Open() 'open the connection
Dim ds As New DataSet
Dim Adapter As New SqlDataAdapter
Dim pivot As String
Dim sql As String
Dim drop As String
'Read the data
drop = "DROP TABLE AssyWIP"
Adapter.SelectCommand = New SqlCommand(drop, sqConQC)
sqConQC.Close()
End Sub
好吧,現在我只是覺得傻了!非常感謝你。我正在剪切並粘貼一些griddataview填充代碼,並嘗試使用適配器來運行鍼對SQL的命令。 – Fedaykin 2013-05-02 00:15:47
@Fedaykin - 不用擔心,很高興我能幫上忙! – sgeddes 2013-05-02 00:24:28