GridView 的编辑更新问题---一次更新N条数据

来源:百度知道 编辑:UC知道 时间:2024/05/21 06:52:02
Repeater 嵌套GridView

每条Repeater 数据后有一个CheckBox

点击CheckBox 选中状态时,此条数据下的GridView 中的其中一列数据
全部呈现为TEXTBOX 在此点击CheckBox 为未选中状态时。。更新GridView数据!

请高手帮下忙!!!!!!!!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;//SQL

namespace 教务管理系统
{
public partial class FormSql : Form
{
private DataTable DT = new DataTable();
private SqlDataAdapter SDA = new SqlDataAdapter();

public FormSql()
{
InitializeComponent();
}

private void FormSql_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("server=(local);database=TMS;user ID=sa;password=sa");
SqlCommand SCD = new SqlCommand("select * from Student", conn);
SDA.SelectCommand = SCD;
SDA.Fill(DT);
dataGridView1.DataSource = DT;

}

private void button1_Click(object sender, EventArgs e)
{
try
{
SqlCommandBuilder SCB = new