数据更新问题 一个datagridview邦定一些数据,请问如何实现当点击一个按钮时,更新datagridview显示的数据的某个字段? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DataGridView加载与绑定数据..for exmaple:private SqlDataAdapter sda = new SqlDataAdapter(); private BindingSource bs = new BindingSource(); public Form1() { InitializeComponent(); } //加载 private void btnLoad_Click(object sender, EventArgs e) { DataBind(); } //数据绑定 private void DataBind() { SqlConnection con = new SqlConnection("server=.;database=student;uid=sa;pwd=0421"); sda = new SqlDataAdapter("select * from studentDetails", con); SqlCommandBuilder buider = new SqlCommandBuilder(sda); DataSet ds = new DataSet(); sda.Fill(ds, "student"); bs .DataSource =ds.Tables ["student"]; this.dataGridView1.DataSource = bs; } //更新 private void btnUpdate_Click(object sender, EventArgs e) { sda.Update((DataTable)bs.DataSource); } liujia_0421(SnowLover)都说了,只有接分了 WinForm里根据设定条件查询出记录输出到报表(ReportViewer) 怎么写,才可以同时在IE和火狐里alert出来的都是文件的路径名 关于改变button按钮形状的问题? 找遍了也找不到C#做类似QQ吸附屏幕边缘的例子 【求助】XML表头的输出! 静默安装 ***************自定义公式运算问题!!***************加急!!!! 请教高手,关于数据库绑定问题 请问:我用VB写了一个组件,如何在C#.net中如何用?在线等待...... PowerDesign9高速下载。要用的兄弟。要快呀 从C#转学Java,应该注意什么? 我的电脑图标
private BindingSource bs = new BindingSource();
public Form1()
{
InitializeComponent();
} //加载
private void btnLoad_Click(object sender, EventArgs e)
{
DataBind();
} //数据绑定
private void DataBind()
{
SqlConnection con = new SqlConnection("server=.;database=student;uid=sa;pwd=0421");
sda = new SqlDataAdapter("select * from studentDetails", con);
SqlCommandBuilder buider = new SqlCommandBuilder(sda);
DataSet ds = new DataSet();
sda.Fill(ds, "student");
bs .DataSource =ds.Tables ["student"];
this.dataGridView1.DataSource = bs;
} //更新
private void btnUpdate_Click(object sender, EventArgs e)
{
sda.Update((DataTable)bs.DataSource);
}