与ASP GridView和DISTINCT与OleDB(访问文件)有关系吗?

时间:2018-09-13 06:33:14

标签: asp.net ms-access oledb aspxgridview

我有一个带有MS Access文件的ASP GridView。我的问题是,当我将“ DISTINCT”关键字添加到SelectCommand(如下所示)时,ASP GridView被破坏了。

SqlDataSource1.ConnectionString = MyConfigurationManager.eapFilePath;
SqlDataSource1.SelectCommand = @"
SELECT  DISTINCT [Alias], [Name], [Stereotype], [Note], 
        IIF(IsNull(b.[Value]), 'n/a', b.[Value]) as [BB_DocID], 
        IIF(IsNull(c.[Value]), 'n/a', c.[Value]) as [BB_Responsible], 
        IIF(InStr([Alias], '-')-1>0, LEFT([Alias], InStr([Alias], '-')-1), [Alias]) as [Source], 
        [Name] as [Section],
        IIF(IsNull(d.[Value]), 'n/a', d.[Value]) as [BB_Source], 
        IIF(IsNull(e.[Value]), 'n/a', e.[Value]) as [DeliverableType],
        IIF(IsNull(f.[Value]), 'n/a', f.[Value]) as [RecordType]
FROM ((((
[t_object] a 
LEFT JOIN (SELECT [Object_ID], [Value] FROM [t_objectproperties] WHERE Property='BB_DocID') b ON a.[Object_ID]=b.[Object_ID])
LEFT JOIN (SELECT [Object_ID], [Value] FROM [t_objectproperties] WHERE Property='BB_Responsible') c ON a.[Object_ID]=c.[Object_ID])
LEFT JOIN (SELECT [Object_ID], [Value] FROM [t_objectproperties] WHERE Property='BB_Source') d ON a.[Object_ID]=d.[Object_ID])
LEFT JOIN (SELECT [Object_ID], [Value] FROM [t_objectproperties] WHERE Property IN ('DeliverableType', 'Deliverable Type')) e ON a.[Object_ID]=e.[Object_ID])
LEFT JOIN (SELECT [Object_ID], [Value] FROM [t_objectproperties] WHERE Property IN ('RecordType', 'Record Type')) f ON a.[Object_ID]=f.[Object_ID]
";

以下是问题的一个示例:

enter image description here

这是一个已知问题吗?没有独特之处,它就像一种魅力。

进一步查看生成的HTML代码,似乎HTML被截断了:

enter image description here

0 个答案:

没有答案