开发者

SQL Server 2005 UniqueIdentifier and C# Data Type

开发者 https://www.devze.com 2022-12-10 19:01 出处:网络
What is the best data type to choose in C# for representing a SQL Server UniqueIdentifier type?I was going to u开发者_运维百科se a GUID but I\'ve seen people using varChars.

What is the best data type to choose in C# for representing a SQL Server UniqueIdentifier type? I was going to u开发者_运维百科se a GUID but I've seen people using varChars.

Thanks


System.Guid is what you need.

You can learn about CLR equivalents of SQL data types in this article:

SQL Server Data Types and Their .NET Framework Equivalents


Whenever I use a uniqueidentifier sql data type I always map it to a Guid in C#. I don't think I've ever seen it done differently.


GUID is the best choice.


GUID is the direct comparison.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号