开发者

Can I use a WHERE clause and still use SQLCommandBuilder?

I wanted to be able to do the below, but not sure if SQLCommandBulder will blow up. (I DON'T have all my code setup to test it yet).

Dim renameFileCmd As SqlCommand = New SqlCommand("select * from 开发者_JAVA技巧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)


According to Henk Holterman. Using a simple Where clause is acceptable for a SqlCommandBuilder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜