Excelシートに保存されるdatagridviewを介してデータテーブル値を更新する方法...次回Excelファイルをロードするときに変更がdatagridviewで更新されるようにする
1 に答える
0
「GridView からデータを取得し、そのデータを asp.net の DataTable に格納する」について話している場合は、これを試してください
DataTable yourDT = new DataTable();
yourDT.Columns.Add("content");
// Add your columns here
foreach (GridViewRow row in gvParent.Rows)
{
string Content = row.Cells[0].Text; // If you are using databound columns
string ContentFromLabel = ((Label)row.Cells[0].FindControl("YourLabel")).Text;// If you are using Template column
// get more columns like this that you have added
yourDT.Rows.Add(new object[] { Content, .... other data });
}
于 2012-06-23T07:59:19.863 に答える