С чем связано исчезновение названий полей в запросе?
Почему вдруг, вместо названия поля, стоят NULL-ы?
exec sp_executesql N'SELECT TOP 40
NULL AS [ID],
NULL AS [CreatedOn],
NULL AS [Number],
NULL AS [UrFaceID],
[tbl_UrFace].[Name] AS [NameUrFace],
[tbl_Contact].[Name] AS [NameManager],
NULL AS [ContractID],
[tbl_Contract].[ContractNumber] AS [ContractNumber],
NULL AS [AccountID],
[tbl_Account].[Name] AS [NameAccount],
NULL AS [SiteID],
[tbl_Site].[Name] AS [NameSite],
NULL AS [Description],
[tbl_ContactKD].[Name] AS [NameKD],
[tbl_ContactOD].[Name] AS [NameOD],
[tbl_ContactRO].[Name] AS [NameRO],
NULL AS [PositionID]
FROM
[tbl_ChangeTariff] AS [tbl_ChangeTariff]
LEFT OUTER JOIN
[tbl_UrFace] AS [tbl_UrFace] ON [tbl_UrFace].[ID] = [tbl_ChangeTariff].[UrFaceID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_Contact] ON [tbl_Contact].[ID] = [tbl_ChangeTariff].[ManagerID]
LEFT OUTER JOIN
[tbl_Contract] AS [tbl_Contract] ON [tbl_Contract].[ID] = [tbl_ChangeTariff].[ContractID]
LEFT OUTER JOIN
[tbl_Account] AS [tbl_Account] ON [tbl_Account].[ID] = [tbl_ChangeTariff].[AccountID]
LEFT OUTER JOIN
[tbl_Site] AS [tbl_Site] ON [tbl_Site].[ID] = [tbl_ChangeTariff].[SiteID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactKD] ON [tbl_ContactKD].[ID] = [tbl_ChangeTariff].[ContactKDID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactOD] ON [tbl_ContactOD].[ID] = [tbl_ChangeTariff].[ContactODID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactRO] ON [tbl_ContactRO].[ID] = [tbl_ChangeTariff].[ContactROID]
WHERE
([tbl_ChangeTariff].[ID] > @P1)',N'@P1 varchar(38)','{00000000-0000-0000-0000-000000000000}'
NULL AS [ID],
NULL AS [CreatedOn],
NULL AS [Number],
NULL AS [UrFaceID],
[tbl_UrFace].[Name] AS [NameUrFace],
[tbl_Contact].[Name] AS [NameManager],
NULL AS [ContractID],
[tbl_Contract].[ContractNumber] AS [ContractNumber],
NULL AS [AccountID],
[tbl_Account].[Name] AS [NameAccount],
NULL AS [SiteID],
[tbl_Site].[Name] AS [NameSite],
NULL AS [Description],
[tbl_ContactKD].[Name] AS [NameKD],
[tbl_ContactOD].[Name] AS [NameOD],
[tbl_ContactRO].[Name] AS [NameRO],
NULL AS [PositionID]
FROM
[tbl_ChangeTariff] AS [tbl_ChangeTariff]
LEFT OUTER JOIN
[tbl_UrFace] AS [tbl_UrFace] ON [tbl_UrFace].[ID] = [tbl_ChangeTariff].[UrFaceID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_Contact] ON [tbl_Contact].[ID] = [tbl_ChangeTariff].[ManagerID]
LEFT OUTER JOIN
[tbl_Contract] AS [tbl_Contract] ON [tbl_Contract].[ID] = [tbl_ChangeTariff].[ContractID]
LEFT OUTER JOIN
[tbl_Account] AS [tbl_Account] ON [tbl_Account].[ID] = [tbl_ChangeTariff].[AccountID]
LEFT OUTER JOIN
[tbl_Site] AS [tbl_Site] ON [tbl_Site].[ID] = [tbl_ChangeTariff].[SiteID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactKD] ON [tbl_ContactKD].[ID] = [tbl_ChangeTariff].[ContactKDID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactOD] ON [tbl_ContactOD].[ID] = [tbl_ChangeTariff].[ContactODID]
LEFT OUTER JOIN
[tbl_Contact] AS [tbl_ContactRO] ON [tbl_ContactRO].[ID] = [tbl_ChangeTariff].[ContactROID]
WHERE
([tbl_ChangeTariff].[ID] > @P1)',N'@P1 varchar(38)','{00000000-0000-0000-0000-000000000000}'
в коде делал так:
var Dataset = DataGrid.DatasetLink.Dataset;
EnableDatasetFilters(Dataset, true, 'PositionWorkingID');
EnableDatasetFilters(Dataset, false, 'ManagerID');
if (grdData.ActiveView.Name == dgvChangeTareiff.Name) {
Dataset.Close();
EnableDatasetFilters(Dataset, false, 'PositionWorkingID');
Dataset.Open();
}
EnableDatasetFilters(Dataset, true, 'PositionWorkingID');
EnableDatasetFilters(Dataset, false, 'ManagerID');
if (grdData.ActiveView.Name == dgvChangeTareiff.Name) {
Dataset.Close();
EnableDatasetFilters(Dataset, false, 'PositionWorkingID');
Dataset.Open();
}
и так:
var Dataset = Services.GetNewItemByUSI('ds_ChangeTariff');
EnableDatasetFilters(Dataset, true, 'PositionWorkingID');
EnableDatasetFilters(Dataset, false, 'ManagerID');
if (grdData.ActiveView.Name == dgvChangeTareiff.Name) {
Dataset.Close();
EnableDatasetFilters(Dataset, false, 'PositionWorkingID');
Dataset.Open();
};
DataGrid.DatasetLink.Dataset = Dataset;
EnableDatasetFilters(Dataset, true, 'PositionWorkingID');
EnableDatasetFilters(Dataset, false, 'ManagerID');
if (grdData.ActiveView.Name == dgvChangeTareiff.Name) {
Dataset.Close();
EnableDatasetFilters(Dataset, false, 'PositionWorkingID');
Dataset.Open();
};
DataGrid.DatasetLink.Dataset = Dataset;
результат тот же...
версия 3.0.2.244
Нравится
5 комментариев
26 сентября 2012 13:49
Здравствуйте, SSV.
Если у Вас возникнут дополнительные вопросы - обращайтесь.
28 сентября 2012 13:50
Здравствуйте, SSV.
не совсем понятно, на какой вопрос Вы ожидаете ответ?
Насколько я понял, вопрос из топика Вам удалось решить:
"SSV" написал:разобрался... если дать права на группу таблиц, то запрос выполняется нормально...
Если у Вас есть дополнительные вопросы, пожалуйста задавайте:
"Олейник Дмитрий" написал:Здравствуйте, SSV.
Если у Вас возникнут дополнительные вопросы - обращайтесь.
С уважением,
Олейник Дмитрий
Эксперт 3-й линии поддержки
Показать все комментарии
Войдите или зарегистрируйтесь, что бы комментировать