MySql 服务器内部联接查询中的无效对象名称错误
Invalid object name error in MySql Server Inner join query
下面的内连接查询出错。
查询:
select resultId,Analysed.bugId as BugDet,bugType
from Analysed
INNER JOIN Bug on Analysed.bugId=Bug.bugId where Analysed.runId=118
架构:
[Analysed table]-(runId,resultId,bugId)
[Bug Table]-(bugId,bugType)
错误:
A field or property with the name 'BugDet' was not found on the selected data source.
实际上,我在 gridView 中使用它。
代码.
<asp:
SqlDataSource ProviderName="System.Data.SqlClient"
ID = "SqlDataSource1" runat = "server"
ConnectionString = "Data Source=(localdb)\v11.0;Initial Catalog=Dash;Integrated Security=SSPI" SelectCommand = "select resultId,Analysed.bugId as BugDet,bugType from Analysed INNER JOIN Bug on Analysed.bugId=Bug.bugId where Analysed.runId=118"
/>
<asp:
GridView ID = "GridView1"
runat = "server"
DataSourceID = "sourceProducts"
AutoGenerateColumns = "False"
CssClass="table-hover table push"
AllowPaging="true"
AllowSorting="true"
PageSize="5"
>
<Columns>
<asp:BoundField DataField = "resultId" HeaderText = "ResulId" />
<asp:BoundField DataField = "BugDet" HeaderText = "BugId" />
<asp:BoundField DataField="bugType" HeaderText="BugType" />
</Columns>
我找到了 error.Thank 试图提供帮助的你们。
网格视图的 dataSourceId 与 sql 提供商的 ID 不匹配。
下面的内连接查询出错。
查询:
select resultId,Analysed.bugId as BugDet,bugType
from Analysed
INNER JOIN Bug on Analysed.bugId=Bug.bugId where Analysed.runId=118
架构:
[Analysed table]-(runId,resultId,bugId)
[Bug Table]-(bugId,bugType)
错误:
A field or property with the name 'BugDet' was not found on the selected data source.
实际上,我在 gridView 中使用它。
代码.
<asp:
SqlDataSource ProviderName="System.Data.SqlClient"
ID = "SqlDataSource1" runat = "server"
ConnectionString = "Data Source=(localdb)\v11.0;Initial Catalog=Dash;Integrated Security=SSPI" SelectCommand = "select resultId,Analysed.bugId as BugDet,bugType from Analysed INNER JOIN Bug on Analysed.bugId=Bug.bugId where Analysed.runId=118"
/>
<asp:
GridView ID = "GridView1"
runat = "server"
DataSourceID = "sourceProducts"
AutoGenerateColumns = "False"
CssClass="table-hover table push"
AllowPaging="true"
AllowSorting="true"
PageSize="5"
>
<Columns>
<asp:BoundField DataField = "resultId" HeaderText = "ResulId" />
<asp:BoundField DataField = "BugDet" HeaderText = "BugId" />
<asp:BoundField DataField="bugType" HeaderText="BugType" />
</Columns>
我找到了 error.Thank 试图提供帮助的你们。 网格视图的 dataSourceId 与 sql 提供商的 ID 不匹配。