none
ASP.NET LINQ : Assign Result Set To ASP.NET Controls RRS feed

  • Question

  • Hi Experts,

    I have LINQ query, which returns output in Tabular format.

    My question is that, how to assign result set's value to ASP.NET controls like TextBox or Label?

    Thanks.


    "Knowledge Shared Is Knowledge Gained"
    Tuesday, February 16, 2010 11:56 AM

Answers

  • Hi Experts,

    I have done it using following manner:

            private void FillPageContents()
            {         
                int iPatientID = Convert.ToInt32(Session["oSession"]);
                App_DBML.ATI_LinqDataContext db = new AMC_App.App_DBML.ATI_LinqDataContext();
                lblFirstName.Text = db.usp_ATI_ViewPatientsDetails(iPatientID).ElementAt(0).First_Name.ToString();
            }

    Where usp_ATI_ViewPatientsDetails is the name of my Stored Procedure.

    And it worked for me.

    Thanks.

     

     

     


    "Knowledge Shared Is Knowledge Gained"
    • Marked as answer by Vijay Jadhav Tuesday, February 16, 2010 2:59 PM
    Tuesday, February 16, 2010 2:59 PM

All replies

  • Hmm...

    No comments anyone? Am I asking too much or too confusing?
    "Knowledge Shared Is Knowledge Gained"
    Tuesday, February 16, 2010 1:50 PM
  • Hi Experts,

    I have done it using following manner:

            private void FillPageContents()
            {         
                int iPatientID = Convert.ToInt32(Session["oSession"]);
                App_DBML.ATI_LinqDataContext db = new AMC_App.App_DBML.ATI_LinqDataContext();
                lblFirstName.Text = db.usp_ATI_ViewPatientsDetails(iPatientID).ElementAt(0).First_Name.ToString();
            }

    Where usp_ATI_ViewPatientsDetails is the name of my Stored Procedure.

    And it worked for me.

    Thanks.

     

     

     


    "Knowledge Shared Is Knowledge Gained"
    • Marked as answer by Vijay Jadhav Tuesday, February 16, 2010 2:59 PM
    Tuesday, February 16, 2010 2:59 PM