Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sqlParameters and Data Access Application Block 2.0(C#)

3 views
Skip to first unread message

John

unread,
Aug 31, 2006, 5:24:02 AM8/31/06
to
Dear All,

通常如果SqlCommand 中有parameter,我們要用 如下方法定義
cmdUpdate.Parameters.add("@customerID");
cmdUpdate.Parameters["@customerID"].value = 123;

但是Data Access Application Block 的"UpdateDataset"方法在update table 時,sqlcommand
中的
parameters.value 好像是空的,但是可以正常Update Table.

有點不明白,請大家指教!

Remark :

我在Data Access Application Block 的"UpdateDataset"方法中加了以下指令 :
Console.WriteLine("\r\n" + updateCommand.Parameters[3].Value.ToString() +
"<=====>");
結果為 :
<=====>

Thanks you


Unknown

unread,
Sep 12, 2006, 2:47:10 AM9/12/06
to
updateCommand??dataset, dataadapter??????,
???adapter.update()???,updateCommand.Parameters[i].Value????????update
field?object.

Bill Lin, Microsoft

"John" <Jo...@discussions.microsoft.com> wrote in message
news:A51CDB9E-B4B1-4DC0...@microsoft.com...
> Dear All,
>
> ????SqlCommand ??parameter,???? ??????


> cmdUpdate.Parameters.add("@customerID");
> cmdUpdate.Parameters["@customerID"].value = 123;
>

> ??Data Access Application Block ?"UpdateDataset"???update table
> ?,sqlcommand
> ??
> parameters.value ?????,??????Update Table.
>
> ?????,?????!
>
> Remark :
>
> ??Data Access Application Block ?"UpdateDataset"????????? :


> Console.WriteLine("\r\n" + updateCommand.Parameters[3].Value.ToString() +
> "<=====>");

> ??? :
> <=====>
>
> Thanks you
>
>


Unknown

unread,
Sep 12, 2006, 2:57:03 AM9/12/06
to
encoding有問題.

我是說updatecommand是和dataadapter, dataset一起用的,所以只有在adapter.update()的時候,parameter.value才會根據rowstate被assign value.

Bill Lin, Microsoft

"Bill Lin (Microsoft)" <@> wrote in message
news:ezqZGdj1...@TK2MSFTNGP04.phx.gbl...

0 new messages