none
A field or property with the name 'USER_COMMENT' was not found on the selected data source

    Question

  • Please Please help. I am new to Visual Studio and web programming. I'm trying to modify code created by another programmer. 

    This program sits on Sharepoint, user enters a product number, program goes to a SQLserver pl/sql procedure to grab the data and displays it back to the screen in a table type of display.   

    I'm getting this error:

    A field or property with the name 'USER_COMMENT' was not found on the selected data source. 
    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.Web.HttpException: A field or property with the name 'USER_COMMENT' was not found on the selected data source.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace: 
    
    
    [HttpException (0x80004005): A field or property with the name 'USER_COMMENT' was not found on the selected data source.]
       System.Web.UI.WebControls.BoundField.GetValue(Control controlContainer) +1788095
       System.Web.UI.WebControls.BoundField.OnDataBindField(Object sender, EventArgs e) +67
       System.Web.UI.Control.OnDataBinding(EventArgs e) +91
     
    

    Here is the SQLServer procedure selecting the data:

    ALTER PROCEDURE [dbo].[sp_IndBOM]     

    -- Add the parameters for the stored procedure here@ParentItem nvarchar (15)ASBEGIN      -- SET NOCOUNT ON added to prevent extra result sets from      -- interfering with SELECT statements.      SET NOCOUNT ON;    -- Insert statements for procedure hereSELECT      ps.ITEM_NO,                  ps.COMP,                  ps.QTY_PER,                  ib.STK_UM,                  ib.DESC_Col,                  ib.DESC_ADDL,                  ps.OPER_NO,                  ps.SEQ_NO_PS,                  ps.SCRP_FCTR_PS,                  NULL as REC_STAT,                  ps.EFF_END_DATE,                  ib.DRAW_REL,                  ib.DRAW_REV,                  ib.DRAW_DATE,                  ib.DRAW_SIZE,                  ib.STAT_FLAG,                  ib.STK_FLAG,                  ib.CNTRL_FLAG,                  ib.PUR_MFG_FLAG,                  ps.USER_COMMENT                     FROM PRD_STR ps,                   ITEM_BASE ib            WHERE ps.ITEM_NO = @ParentItem               and ps.comp = ib.Item_No

    Here is the invbomlv1.aspx.cs code:

                myDataColumn = new DataColumn();
                myDataColumn.DataType = Type.GetType("System.String");
                myDataColumn.ColumnName = "USER_COMMENT";
                myDataTable.Columns.Add(myDataColumn);

    Here is the invbomlv1.aspx code:

                <asp:BoundField DataField="USER_COMMENT" HeaderText="USER_COMMENT">
                <HeaderStyle Font-Size="10px" />
                <ItemStyle Font-Size="10px" />
                <FooterStyle Font-Size="10px" CssClass="totalRow" />
                </asp:BoundField>
             </Columns>
        </asp:GridView>

    It's like it's not finding the new "USER_COMMENT" field I added to the pl/sql statement. Please help. I don't have the original "project" either so I can't regenerate/build this thing.

    Tuesday, January 29, 2013 6:37 PM

All replies

  • Well, this it the wrong forum for PL/SQL as this it the Oracle SQL dialect. We talk T-SQL :)

    There is a binding problem, which is C# and ASP.NET specific. Your procedure looks okay on the first glance. Are you using EF? Here are some hits for your error message..

    Tuesday, January 29, 2013 7:36 PM
  • Thank you so much for the reply and taking a look at my code. I will keep this forum in my favorites cause I actually got a reply from one!  

    I did check out the "hints" link you provided (thank you), and I had found that but I was a little confused and that issue sounded a little different - but I'm still learning the lingo.   By binding issue you mean that the .aspx/aspx.cs code can't see the field from the SQL Server database select statement right?  But it does see all the other fields in the select, just not this modified one.

    What is EF?    From what I can see, we have a Sharepoint website (the free version), and on another server there is a SQL Server 2005 database which is where the select code is, and on yet another server is where the website is hosted and is where I found the Visual Studio code for the .aspx files.  So I modified the SQL Server procedure for the database, then modified the .aspx and aspx.cs files in Visual Studio and saved them to the server so they show up on the Sharepoint website (which does work). 

    So with that, is ther some kind of "build" or "regeneration" I have to do when adding a field in this situation?

    I posted a question on the "stackoverflow" link you gave me (thanks again), hopefully I got it in the right place now (:

    Tuesday, January 29, 2013 8:00 PM