Note that there are some explanatory texts on larger screens.

plurals
  1. POInner Join with Subsonic
    primarykey
    data
    text
    <p>I am trying to display all records that match the last name entered into a textbox. This requires an INNER JOIN on the "volID" column because there are 2 tables.</p> <pre><code>&lt;asp:TextBox ID="lName" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="true" Visible="true"&gt;&lt;/asp:GridView&gt; &lt;asp:linkButton ID="btnSubmit" runat="server" onclick="btnSubmit_Click" /&gt; </code></pre> <p>Code behind:</p> <pre><code> protected void btnSubmit_Click(object sender, EventArgs e) { GridView1.DataSource = new Select("*") .From(PastAwardName.Schema) .InnerJoin(PastAwardName.VolIDColumn, PastAwardType.VolIDColumn) .Where(PastAwardName.Columns.LName).IsEqualTo(this.lName.Text) .ExecuteReader(); GridView1.DataBind(); } </code></pre> <p>I tried to do this from and example on Subsonics site but cannot get it working. Geeting the error below.</p> <pre><code>Server Error in '/' Application. ________________________________________ The objects "dbo.pastAwardNames" and "dbo.pastAwardNames" in the FROM clause have the same exposed names. Use correlation names to distinguish them. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: The objects "dbo.pastAwardNames" and "dbo.pastAwardNames" in the FROM clause have the same exposed names. Use correlation names to distinguish them. Source Error: Line 30: Line 31: Line 32: GridView1.DataSource = new Select("*") Line 33: .From(PastAwardName.Schema) Line 34: .InnerJoin(PastAwardName.VolIDColumn, PastAwardType.VolIDColumn) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload