求会C#的朋友!我现在没有分了》!
来源:百度知道 编辑:UC知道 时间:2024/06/08 16:35:02
this.employeesBindingSource.Position--;
this.employeesBindingSource.AddNew();
this.employeesBindingSource.RemoveCurrent();
this.employeesTableAdapter.Update(this.northwindDataSet.Employees);
this.employeesBindingSource.EndEdit();//保存
this.employeesTableAdapter.Update(this.northwindDataSet.Employees);
都是什么意思呢?
this.employeesBindingSource.Position++; 移动到下一条记录
this.employeesBindingSource.Position--; 移动到上一条记录
this.employeesBindingSource.AddNew(); 新增一条记录
this.employeesBindingSource.RemoveCurrent(); 删除当前这条记录
this.employeesTableAdapter.Update(this.northwindDataSet.Employees);//将更新回写入dataset
this.employeesBindingSource.EndEdit();//保存
首先这是别人自己写的类,具体内容没有给出来我们只能通过文字猜测了
第一个是把某人的职位提高
第二个是把某人的职位降低
第三个是添加某个员工
第四个好象是清空?
第五个是更新某个员工的信息
第六个写了是保存
我承认我东西很多都是猜测,但你说得也离谱了点吧
你说employeesBindingSource是个datagridview控件
datagridview控件哪来的Position属性?哪来的AddNew() RemoveCurrent()方法?
很明显employeesTableAdapter是个TableAdapter类的实例化.
楼上胡扯了
这里的employeesBindingSource表示的一个datagridview控件
这段代码出自一个.net2.0示例 我在哪看过具体不记得了
知道是什么控件就好办了吧!楼主
employeesTableAdapter是一个适配器
this.northwindDataSet.Employees是一个实体类
---------------------猥琐的分割线---------------------------this.employeesBinding