I am filling a dataset from a SQL server database using SqlDataAdapter in C# 4.0. Is there a way so that I can be able to provide an alternate mapping for the GUID DBDataType to String.
I need the GUID’s to be interpreted as string in the resultant datatable, so if there can be a mapping which automatically sets the GUID to String i can consume that feature, else i have to recreate the datatable and populate the values using linq or other methods, which will be a performance hit
I haven’t seen a way to do a mapping like this with the ADO.NET classes. Instead of trying to map from one data type to another in the
SqlDataAdapter, you could modify your query to convert theuniqueidentifiertovarchar: