Error updating GUID columns

J

Jeff Boenig

I have a uniqueidentifier column in my database (GUID).
In my schema, I declare it as ID. When I call
OleDbDataAdapter.Update() I get an error complaining that
it can't convert from System.String to System.Guid. Do I
have to declare it differently in my schema or do some
type of manual conversion?

Does anyone have any experience with using GUIDs as
primary keys? How does it compare to using a 4 byte
integer as a primary key? Is the performance difference
noticable?

Thanks,

Jeff Boenig
Elsinore Technologies
 
W

Willy Esteban

I use GUIDS and I like them a lot. Using them has eliminated all the
problems related to getting a PK back from the server. All my schemas, which
are created by using the "Generate Dataset" wizard, show string as the data
type in the designer but the XML though looks like this:

<xs:element name="AccountID" msdata:DataType="System.Guid, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type="xs:string" />

The strongly typed dataset types them as GUID.

Willy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top