How to retrieve data from DetailsView Edit??

Discussion in 'Software' started by sakhu, Jul 3, 2007.

  1. sakhu

    sakhu

    Joined:
    Jul 3, 2007
    Messages:
    2
    Likes Received:
    0
    Hi all

    I have following code to display data in DetailsView, but now for editing the dataset from DetailsView I need to read data fromt eh textbox of DetailsView, how can i do that??

    <asp:templatefield headertext="Module Weight" >
    <itemtemplate>
    <asp:label id="FirstNameLabel"
    Text= '<%# Eval("au_fname") %>'
    runat="server"/>
    </itemtemplate>
    <Edititemtemplate>
    <asp:TextBox id="LastNameLabel"
    Text= '<%# DataBinder.Eval(Container.DataItem,"Model_Wt_kg") %>'
    runat="server"/>
    </Edititemtemplate>
    </asp:templatefield>

    In C# code behind to display data in these fields the code which is working fine:
    dbcon.Open();
    adp = new OleDbDataAdapter(sqlStmt,dbcon);
    adp.Fill(ds, "Product");
    closeConnection();
    table1 = ds.Tables["Product"];
     
    sakhu, Jul 3, 2007
    #1
    1. Advertisements

  2. sakhu

    sakhu

    Joined:
    Jul 3, 2007
    Messages:
    2
    Likes Received:
    0
    hi

    I can now read the data from text box, but those data which are displayed from database, nto the data enteretd by user. What shall i do to read the data entered by user in detailsview.
     
    sakhu, Jul 5, 2007
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.