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!

Re: How do I compare 2 UniqueIdentifier Guids? by Andy

Andy
Wed Jun 07 15:33:56 CDT 2006

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

Bmack500 wrote:
> 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!


Re: How do I compare 2 UniqueIdentifier Guids? by Cor

Cor
Thu Jun 08 00:50:32 CDT 2006

Brett,

Probably do you have to create a New Guid from your string

http://msdn2.microsoft.com/en-us/library/system.guid.newguid(VS.80).aspx

I hope this helps,

Cor

"Bmack500" <brett.mack@gmail.com> schreef in bericht
news:1149711385.520781.140990@h76g2000cwa.googlegroups.com...
> 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!
>



Re: How do I compare 2 UniqueIdentifier Guids? by Bmack500

Bmack500
Fri Jun 09 12:14:56 CDT 2006

Thanks! Worked great. I didn't think that it would search for it is a
string...

Andy wrote:
> 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
>
> Bmack500 wrote:
> > 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!