1

vb のクエリ ビルダーでは、INSERT ステートメントを使用できるのは 1 つのテーブルのみであるように思われますが、複数のテーブルを追加する方法はありますか?

4

2 に答える 2

2

それらすべてを 1 つのコマンド呼び出しにラップできるはずです。これがあなたが探していると私が思うものの例です。

vb.netから2つのテーブルに挿入する方法

于 2012-02-13T03:47:18.317 に答える
0
Using con As System.Data.SqlClient.SqlConnection = New SqlConnection("YourConnection string")
    con.Open()
    Dim cmd As New SqlCommand()
    Dim expression As String = "Parameter value"
    cmd.CommandType = CommandType.StoredProcedure
    cmd.CommandText = "Your Stored Procedure"
    cmd.Parameters.Add("Your Parameter Name", SqlDbType.VarChar).Value = expression
    cmd.Connection = con
    Using dr As IDataReader = cmd.ExecuteReader()
        If dr.Read() Then
        End If
    End Using
End Using
于 2012-02-13T13:46:44.493 に答える