更新行 [英] update row

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

问题描述

我是夏普的初学者.我想用sql数据库在c#中创建一个简单的项目.我在数据库名称test1中创建一个表名称"updatetbl",并将记录填充为波纹管

accountno序列
1001 25
1001 5
1001 7
1001 9
1001 10
1001 15

accountno,序列为整数

现在,我想以编程方式在单击按钮中进行更新,以更新值,例如下面的示例.

accountno序列
1001 1
1001 2
1001 3
1001 4
1001 5
1001 6

I am begginers in c sharp . I want to make a simple project in c # with sql database. I creat a table name "updatetbl in database name test1 and fill the record as bellow

accountno sequence
1001 25
1001 5
1001 7
1001 9
1001 10
1001 15

accountno,sequence is int

Now I want to update programatically in single click button to update the value has been changed as bellow example.

accountno sequence
1001 1
1001 2
1001 3
1001 4
1001 5
1001 6

推荐答案

您将需要使用增量编号来更新数据源.

创建一个计数器,每次将其分配到数据源的一行时都会递增.
You will need to update the datasource with an incremental number.

Create a counter which is incremented everytime you assign it to a row of the datasource.


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

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