Now, the problem is that this table also contains a numeric primary key
field set to auto-increment. Whenever I use a regular INSERT statement,
the field does its job and automatically enters the next value.
However, the above method does not. I can just as easily add a field in
the above code, but what value would I assign it? I tried just
assigning it "null" but that didn't work, nor did an empty string. I
could grab the current highest value from the table, add one, and use
that. But wouldn't that risk a race condition if two users are
performing the operation simultaneously?

What do you recommend to solve this? Any help would be much
appreciated. Thank you.
Regards,
David P. Donahuedd******@ccs.neu.edu

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"David P. Donahue" <dd******@ccs.neu.edu> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...

Now, the problem is that this table also contains a numeric primary key field set to auto-increment. Whenever I use a regular INSERT statement, the field does its job and automatically enters the next value. However, the above method does not. I can just as easily add a field in the above code, but what value would I assign it? I tried just assigning it "null" but that didn't work, nor did an empty string. I could grab the current highest value from the table, add one, and use that. But wouldn't that risk a race condition if two users are performing the operation simultaneously?

What do you recommend to solve this? Any help would be much appreciated. Thank you.
Regards, David P. Donahuedd******@ccs.neu.edu

Sure: change the data type of the primary key from an INT to a GUID. In the code below, create your own Guid value ( see Guid.NewGuid() ), and place the value into the table.

In the database itself? I'm seeing no GUID data type. FYI, I'm using
MySQL Control Center to manage a MySQL database. Is the interface just
not showing me this type, or is it something specific to another database?
Regards,
David P. Donahuedd******@ccs.neu.edu