我做了一個查詢的Method
但是前端撈出資料時
卻出現"無法啟用條件約束,一或多個資料列的值違反非Null、唯一或外部索引鍵條件約束"
不知道哪裡設定錯誤
有勞各位大大協助檢查一下
===Method===
public string GetMasterName(Guid telesalesId)
{
EmployeeDataSet.User_GroupsDataTable dt = new EmployeeDataSet.User_GroupsDataTable();
taUserGroup.GetMasterName(dt, telesalesId);
if (dt.Rows.Count > 0)
{
EmployeeDataSet.User_GroupsRow dr = (EmployeeDataSet.User_GroupsRow)dt.Rows[0];
return dr.UserName;
}
else
{ return ""; }
}
===Table===
GetMasterName
ExecuteMode = Reader
GenerateMethods = Fill
Parameters = @SellId
ProviderType = UniqueIdentifier
Command Text =
"SELECT aspnet_Users.UserName, User_Groups.MasterId, User_Groups.SellId,
User_Groups.CreateDate
FROM aspnet_Users INNER JOIN
User_Groups ON aspnet_Users.UserId = User_Groups.MasterId
WHERE (User_Groups.SellId = @SellId)
ORDER BY User_Groups.CreateDate DESC"