Microsoft
Software
Hardware
Network
Question : Asp.Net Conversion failed when converting from a character string to uniqueidentifier.
this is my string:
SelectCommand="SELECT '' as UserId, '' as [Company], '' as [WebSiteUrl] UNION SELECT UserId, Company, WebSiteUrl FROM [UserProfile] ORDER BY [Company]">
this is my error:
--------------------------
----------
----------
----------
----------
----------
----
Conversion failed when converting from a character string to uniqueidentifier.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
xception: Conversion failed when converting from a character string to uniqueidentifier.
--------------------------
----------
----------
----------
----------
----------
------
this portion of my code: can be: '' as UserId or '0' as UserId that for a string or a int
I do not know what it would take to convert the Guid to a string as to replace '' as UserId.
Answer : Asp.Net Conversion failed when converting from a character string to uniqueidentifier.
how about this one:
SelectCommand="SELECT '"+Guid.Empty.ToString()+"
' as UserId, '' as [Company], '' as [WebSiteUrl] UNION SELECT UserId, Company, WebSiteUrl FROM [UserProfile] ORDER BY [Company]"
Random Solutions
Looping through rows of controls
Help Virtualizing Server Rooms
SQL Server Correlated sub query
Remove data row
DHCP on Server 2003
Domino 8.5.2 Upgrade from 8.5.1 on Server 2008 R2 64 Bit
Which is the BEST to secure LAN : WEP, WPA or WPA2?
Multiple Pop Up Windows
How to determine source of error on 3750-stack?
using autoexec macro to update database with windows scheduled tasks