Click here to Skip to main content
11,721,053 members (77,121 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# 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 20:58pm
Edited 19-Sep-12 21: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
0 Sergey Alexandrovich Kryukov 475
1 OriginalGriff 279
2 Mika Wendelius 170
3 F-ES Sitecore 130
4 cyycoish 70
0 Sergey Alexandrovich Kryukov 2,199
1 OriginalGriff 959
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web04 | 2.8.150901.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2015
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