我希望能够执行以下操作,但不确定SQLCommandBulder是否会爆炸。 (我没有设置所有代码来测试它。)
Dim renameFileCmd As SqlCommand = New SqlCommand("select * from FileVersions where vpk = @vpk", sqlConn)
renameFileCmd.Parameters.Add("@vpk", SqlDbType.BigInt)
renameFileCmd.Parameters.Item(0).Value = vpk
renameFileCmd.CommandType = CommandType.Text
Dim renameFileAdptr As SqlDataAdapter = New SqlDataAdapter(renameFileCmd)
Dim renameFileBuilder As SqlCommandBuilder = New SqlCommandBuilder(renameFileAdptr)
Dim renameFileDataTable As DataTable = New DataTable
renameFileAdptr.Fill(renameFileDataTable)
答案 0 :(得分:0)
根据Henk Holterman的说法。对于SqlCommandBuilder,可以使用简单的Where子句。