简体   繁体   English

MySql Server内部联接查询中的无效对象名称错误

[英]Invalid object name error in MySql Server Inner join query

The below inner join query gives error. 下面的内部联接查询给出错误。

QUERY: 查询:

select resultId,Analysed.bugId as BugDet,bugType  

from Analysed

INNER JOIN Bug on Analysed.bugId=Bug.bugId where Analysed.runId=118 

SCHEMA : 模式:

[Analysed table]-(runId,resultId,bugId) [分析表]-(runId,resultId,bugId)

[Bug Table]-(bugId,bugType) [错误表格]-(bugId,bugType)

Error: 错误:

A field or property with the name 'BugDet' was not found on the selected data source. 在所选数据源上找不到名称为“ BugDet”的字段或属性。

Actually,I am using it inside a gridView. 实际上,我在gridView中使用它。

Code . 代码

<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>

I found the error.Thank you all who tried to help. 我发现了错误。感谢所有尝试提供帮助的人。 The dataSourceId of the grid view was not matching the id of the sql provider. 网格视图的dataSourceId与sql provider的ID不匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM