Click here to Skip to main content
12,698,137 members (24,680 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# MS-Excel
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,

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 19-Sep-12 21:58pm
Updated 19-Sep-12 22:00pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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");
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100