Home All Groups Group Topic Archive Search About

<target>.PrimaryKey Merge Error

Author
14 Feb 2006 8:41 PM
Tom_B
Running a VB.Net console application that uses data from a VB.Net webservice.
Both the data sent and received are accessed with strongly-typed datasets.

With dsMapping
          ds = WS.WorkOrdersForReprint(StoreId)
          .EnforceConstraints = False
          .Merge(ds)
End With

The above generates this error message at the Merge statement:

"<target>.PrimaryKey and <source>.PrimaryKey have different Length."

The key length is 1 (one column) and type is integer for both ds and
dsMapping.

This works except for one table.  Any ideas as to what is wrong and how to
correct?

Thanks.

Author
15 Feb 2006 10:05 AM
Miha Markic [MVP C#]
Are you sure that they don't differ fot that table?
And why do you use Lenght on int?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Tom_B" <T***@discussions.microsoft.com> wrote in message
news:99E18F67-718B-49A8-B5E4-35D3768DF00D@microsoft.com...
> Running a VB.Net console application that uses data from a VB.Net
> webservice.
> Both the data sent and received are accessed with strongly-typed datasets.
>
> With dsMapping
>          ds = WS.WorkOrdersForReprint(StoreId)
>          .EnforceConstraints = False
>          .Merge(ds)
> End With
>
> The above generates this error message at the Merge statement:
>
> "<target>.PrimaryKey and <source>.PrimaryKey have different Length."
>
> The key length is 1 (one column) and type is integer for both ds and
> dsMapping.
>
> This works except for one table.  Any ideas as to what is wrong and how to
> correct?
>
> Thanks.
Author
15 Feb 2006 2:08 PM
Tom_B
Both target and source keys are the same length and data type.

I don't use the length -- that was an observation.

AddThis Social Bookmark Button