Detail view error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neoupadhyay
    New Member
    • Feb 2007
    • 57

    Detail view error

    hi friend,

    I m using asp.net2.0 with c#, I have a form where i have multiview control, and on a multiview control.....i have a combo box, and a detail view. now on the select idex change of combo box i write the below code, where i got error...

    ie.
    I got This Error msg "Both DataSource and DataSourceID are defined on 'DetailsView3'. Remove one definition"

    my code is :-

    protected void cboLoanSelect_S electedIndexCha nged(object sender, EventArgs e)
    {



    string connectionStrin g = ConfigurationMa nager.Connectio nStrings["sqlFWA"].ConnectionStri ng;

    SqlDataAdapter ad = new SqlDataAdapter( "Select PropertyLoan_ID ,LendersName,Ac countNumber,BSB ,TermOfLoan,Pay mentDueDayOfMon th,InterestChar gedDayOfMonth,I nterestRate,Loa nAmount,LoanTyp e_ID,DateLoanCo mmenced,LoanEnd Date,LoanPaid,M onthlyPayment,I nvestmentPurpos e,LendersPhoneN umber,LoanNotes from tblPropertyLoan s where PropertyLoan_ID =" + System.Convert. ToInt32(cboLoan Select.Selected Item.Value), connectionStrin g);

    DataSet ds = new DataSet();

    ad.Fill(ds, "property") ;

    DetailsView3.Da taSource = ds;

    DetailsView3.Da taBind();

    }

    thnx
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Here is an article that may help:
    ASP.NET data binding overview

    Comment

    Working...