重新安排数据表 [英] Re-arrange the datatable

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

问题描述

大家好,

我是sakshi.
我正在使用ms sql数据库创建一个基于c#.net Windows的项目.
我正在使用运行良好的删除查询.
但我的问题是------
我想在删除后重新排列数据表.
as-i的行具有主键1,2,3,4,5,6.
删除1,5行后,它变为2,3,4,6.
我希望它应该是1,2,3,4,这意味着剩余的行应从1开始重新排列.

请回复.

非常感谢.

hello everybody,

i am sakshi.
i am creating a c#.net windows based project with ms sql database.
i am using delete query which is working well.
but my problem is------
i want to re-arrange the datatable after deletion.
as-i have rows having primary key 1,2,3,4,5,6.
after delting 1,5 row,it becomes 2,3,4,6.
i want that it should be 1,2,3,4 means remaining rows should be re-arrange staring from 1.

please reply.

thanks alot.

推荐答案

为什么要这样?
不建议更改您的主键.其中一个其他的选择将处理它的前端.
请说明您的情况,我们会为您提供更好的帮助.
Why do you want it that way?
It is not advisable to change your primary key. One of the other options would be to handle it on front end.
Explain your scenario and we could help better.


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

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