将值更新为excel [英] update value to excel

查看:105
本文介绍了将值更新为excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在Excel中更新一行.通过在文本字段中输入值并将这些值传递到网格并将数据集传递到excel. 现在我有两个链接可以在网格中进行编辑和更新.在单击更新"按钮进行编辑后,网格中的值将被更新.但不是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;
       }


您能否指导我如何在excel中更新值.





谢谢..!
.


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





Thanks..!
.

推荐答案

Excel吗?
尝试将数据更新到更可能是的csv 搜索如何创建csv并使用该代码更新您的excel csv.
就像
File.appendtext("asdf.csv","name,blabla/n/r");
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");


查看:
使用OLEDB读写Excel [
Look at:
Reading and Writing Excel using OLEDB[^]


这篇关于将值更新为excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆