This is my first time trying to write something in ASP.net so please bear with me if I don't explain it correctly.
I created a view in SQL and attached it to a sql data source in my ASP page and displayed it using a data list.
I ran the page and the information comes back no problem with the correct data. The statement looked like this :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yardi_reportConnectionString %>"
SelectCommand="SELECT * FROM PH_UnitStats] "></asp:SqlDataSource>
So the goal was to attach the page as a webpart in Sharepoint. Within Sharepoint we have several properties. So based on the property selected the url when then pass the property code to the asp page to query only that recordset where propid = ?
So my statement in the asp page looks like this now :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yardi_reportConnectionString %>"
SelectCommand="SELECT * FROM [PH_UnitStats] where p.hmy = 'iddetail'"></asp:SqlDataSource>
where p.hmy is the column in the property table
where the declaration above is :
Dim iddetail
iddetail = Request.QueryString("propid")
Now that I have added this and try to run it I am getting the following error:
SqlException (0x80131904): The column prefix 'p' does not match with a table name or alias name used in the query.]
Any help or guidance is greatly appreciated
I created a view in SQL and attached it to a sql data source in my ASP page and displayed it using a data list.
I ran the page and the information comes back no problem with the correct data. The statement looked like this :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yardi_reportConnectionString %>"
SelectCommand="SELECT * FROM PH_UnitStats] "></asp:SqlDataSource>
So the goal was to attach the page as a webpart in Sharepoint. Within Sharepoint we have several properties. So based on the property selected the url when then pass the property code to the asp page to query only that recordset where propid = ?
So my statement in the asp page looks like this now :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yardi_reportConnectionString %>"
SelectCommand="SELECT * FROM [PH_UnitStats] where p.hmy = 'iddetail'"></asp:SqlDataSource>
where p.hmy is the column in the property table
where the declaration above is :
Dim iddetail
iddetail = Request.QueryString("propid")
Now that I have added this and try to run it I am getting the following error:
SqlException (0x80131904): The column prefix 'p' does not match with a table name or alias name used in the query.]
Any help or guidance is greatly appreciated