我想根據帳戶GUID檢索客戶端名稱,使用sql和c#。將字符串轉換爲System.guid c#
static DataClasses1DataContext dbDataClasses = new DataClasses1DataContext();
static void Main(string[] args)
{
var accountList = from accounts in dbDataClasses.ACCOUNTs where accounts.AccountGUID.ToString() = "e8d82d5d-b7bd-4b24-a7fe-ef050921e960"
select accounts;
foreach (ACCOUNT temp in accountList)
{
Console.WriteLine("Account Name: " + temp.Name + " Account GUID: " + temp.AccountGUID);
}
}
不過,我收到一個錯誤說「無法隱式轉換類型‘字符串’到‘的System.Guid’
任何幫助,將不勝感激。謝謝
[Guid.Parse](http://msdn.microsoft.com/en-us/library/system.guid.parse.aspx) – Stijn