Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to update a row in my excel. By entering values in text field and passing those values to grid and passing the dataset to excel..
now I have two links edit and update in grid..After editing on clicking the update button, the value in the grid gets updated. but not in excel..
I just tried the below code,

C#
protected void lnkEdit_Click(object sender, EventArgs e)
        {
            
            LinkButton Edit1 = (LinkButton)sender;
            GridViewRow row = (GridViewRow)Edit1.NamingContainer;

            txtCodeID.Text = ((Label)row.FindControl("CodeID")).Text;
            txtContent.Text = ((Label)row.FindControl("Content")).Text;
            txtMappingCode.Text = ((Label)row.FindControl("MappingCode")).Text;
            btnSave.Visible = true;
            
        }
        protected void lnkUpdate_Click(object sender, EventArgs e)
        {
            LinkButton Save = (LinkButton)sender;
            GridViewRow row = (GridViewRow)Save.NamingContainer;

            ((Label)row.FindControl("CodeID")).Text = txtCodeID.Text;
            ((Label)row.FindControl("Content")).Text = txtContent.Text;
            ((Label)row.FindControl("MappingCode")).Text = txtMappingCode.Text;
            btnSave.Visible = true;
       }

Can u pls guide me on how to update values in excel.





Thanks..!
.
Posted
Updated 19-Sep-12 21:00pm
v2

Excel ?
Try to update data to a csv thats more likely
search for how to create a csv and use that code to update your excel csv.
It will be something like
File.appendtext("asdf.csv","name,blabla/n/r");
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900