Could anybody help me understand why VS.NET when
a table is dragged onto the form creates 'double' parameters
for data adapter's command objects, as for example shown
below for "Original_First_Name" and "Original_First_Name1"?
What would happen if I removed "Original_First_Name1"?
And why this is created at first place?

Thanks in advance,

Strah


Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1

Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_SSN",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"SSN", System.Data.DataRowVersion.Original, Nothing))

Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_First_Name",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"First_Name", System.Data.DataRowVersion.Original, Nothing))

Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_First_Name1",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"First_Name", System.Data.DataRowVersion.Original, Nothing))

Re: excess parameters? by Strahimir

Strahimir
Tue Aug 19 07:30:27 CDT 2003

David,

Thanks for your reply...

I am very surprised to get

an explanation from Sceppa

himself... Thanks again,

Strah



"David Sceppa" <davidsc@online.microsoft.com> wrote in message
news:4CFrSrdZDHA.2116@cpmsftngxa06.phx.gbl...
> Strah,
>
> They're likely there for null comparisons in concurrency
> checks. According to ANSI standards, NULL = NULL evaluates to
> false. You want the concurrency check to succeed if the column
> matches the local value or if they are both null. Thus, the
> UPDATE query looks like:
>
> UPDATE MyTable SET SSN = ?, FirstName = ?
> WHERE SSN = ? AND
> (FirstName = ? OR (FirstName IS NULL AND ? IS NULL))
>
> I hope this information proves helpful.
>
> David Sceppa
> Microsoft
> This posting is provided "AS IS" with no warranties,
> and confers no rights. You assume all risk for your use.
> © 2003 Microsoft Corporation. All rights reserved.
>