You should tell us what the value of
Request.QueryString.Get("ID")
is.
From the exception it seems clear that
Request.QueryString.Get("ID")
does not represent a valid GUID
Ok you cannot convert an int to a GUID, I'm not sure you know what it actually is so give this wiki entry a read
Globally unique identifier[
^].
That said if you just remove the line
Guid ID = new Guid(Request.QueryString.Get("ID"));
then your code should work as you don't even use the variable
ID
.
GetItem
takes a Guid but now you're trying to convert the Guid to an integer (
objpar.Add(new csParameterListType("@ID", SqlDbType.Int, ID));
) so
forget about Guid
and just use
int