在asp.net中自动生成序列号 [英] auto generate serial number in asp.net

查看:80
本文介绍了在asp.net中自动生成序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我手头有一个项目。我必须输入序列号,类别描述,成本价格,销售价格和图片上传。



我希望序列号通过自动生成自动生成但不是身份属性。



所以如果一个用户输入20条记录并注销。然后说2小时后另一个用户登录并输入数据,那个序列号21应该显示出来,以便第二个用户知道第一个用户已经输入了20个记录。



是否有可能在asp.net中这样做?



我不想要代码。我只是想要它是否可以完成,如果是,是否有任何技术?



我希望序列号应该像1,2,3一样自动生成序列。 ...



例如。



用户1输入20条记录



当用户2登录时,她会在序列号上看到21号码添加时的字段。所以她知道已经在数据库中输入了20条记录。



谢谢

Sudeshna

解决方案

[ ^ ]



欢呼


页面上的MAX查询



int query =从表中选择max(product_code)

SqlDataAdapter da = new SqlDataAdapter(query,SQLCONNECTION);

DataTable dt = new DataTable( );

da.Fill(dt);

if(dt.rows.count> 0)

{

query = query + 1;

query = textbox.text

}



这真的是真的有帮助

Hi
I have a project in hand. where i have to enter serial number,category description,cost price,sale price and image upload.

I want serial number to come automatically through auto generated but not with is identity property.

so if one user enters 20 records and logs off. and then say after 2hrs another user logs in and enters data, that time serial number 21 should get displayed so that the 2nd user understands that 1st user has entered 20 records before her.

is it possible to do this way in asp.net?

i dont want the code. i just want if it can be done and if yes is there any technique?

and i want the serial number should get auto generated sequentialy like 1,2,3....

for example.

user 1 enters 20 records

when user 2 logs in she will see 21 number on serial number field while adding. so that she is aware that 20 records already entered in database.

Thanks
Sudeshna

解决方案

[^]

cheers


MAX Query on pageload

int query= select max(product_code) from table
SqlDataAdapter da= new SqlDataAdapter(query, SQLCONNECTION);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.rows.count>0)
{
query = query+1;
query= textbox.text
}

It would be really helpful


这篇关于在asp.net中自动生成序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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