How do I compare 2 UniqueIdentifier Guids?

  • Thread starter Thread starter Bmack500
  • Start date Start date
B

Bmack500

Hello. I have two databases, both of which store an objectGUID (from a
contact object) in a UniqueIdentifier Column.

How can I search a value picked up in one (using sqlreader) to a value
in the other table? For example, using the following:


"SELECT * FROM table1 Where objectGUID = '" & sqlReader3("guid") & "'"


This just tells me that I cannot compare objects. How do I cast them,
and what is the syntax for the sql command?


Thanks in advance!
 
sql = string.Format( "SELECT * FROM table1 Where objectGUID = '{0}'",
sqlReader3( "guid" ).ToString() );

It may be hard to miss, but there are single quotes ( ' ) around the
{0}.

HTH
Andy
 
Back
Top