解決DataSet的Query無法使用 Where In 的語法

試了很久,
Where XX In ?
Where XX In (?)
Where XX In (‘?’)
都不行,還以為只能從Store Procedure解了哩~
因為他DBCommand 只吃 Where XX In (@P1,@P2),這個在一般自己串是OK,可是在DataSet裡面沒辦法猜到runtime會需要幾個Param

今天Will提說試試Partial Class,於是測試一下,還可以跑哩,只是不知道效率怎樣而已?
流程先去把DataSet.Designer.cs的Query函式copy出來,然後 OleDbCommand dm= this .Connection.CreateCommand();接下來就是串SQL字串了~

This entry was posted in 電腦和網際網路. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s