Re: uniqueidentifier in SQL Query
From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 10/13/04
- Next message: ESPN Lover: "How to reset a StringBuilder?"
- Previous message: Lucas Tam: "Re: uniqueidentifier in SQL Query"
- In reply to: Kenneth Keeley: "uniqueidentifier in SQL Query"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 12 Oct 2004 20:12:05 -0400
(untested)
Dim cmd As New SqlCommand("SELECT Id, Title, Publication, InsertDate,
NoPages, Colour, Status FROM Features WHERE Id=@guid", DataBaseConnection)
cmd.Parameters.Add(New SqlParameter("@guid", SqlDbType.UniqueIdentifier,
16)).Value = New Guid(Request.QueryString("id").ToString)
Dim da as New SqlDataAdapter(cmd)
Greg
"Kenneth Keeley" <kenkeeley@hotmail.com> wrote in message
news:uT5hGbLsEHA.2788@TK2MSFTNGP09.phx.gbl...
> Hi,
> I am trying to get the results out of an SQL database where the Id is
> equal to a given value. The Id field is a uniqueidentifier this is what I
> am
> trying to do.
>
> SQLQuery = new SqlDataAdapter("SELECT Id, Title, Publication, InsertDate,
> NoPages, Colour, Status " +
> "FROM Features WHERE Id={guid {" + Request.QueryString[ "id" ] + "}};",
> DataBaseConnection);
>
> The Querystring value looks like this
> "3B9767E0-56DD-49FB-8CC0-79A8FE95CEFF"
>
> I keep getting errors and I would like to find a sample of how to do this.
>
> Thanks
> Kenneth.
>
>
- Next message: ESPN Lover: "How to reset a StringBuilder?"
- Previous message: Lucas Tam: "Re: uniqueidentifier in SQL Query"
- In reply to: Kenneth Keeley: "uniqueidentifier in SQL Query"
- Messages sorted by: [ date ] [ thread ]