当我点击按钮时增加价值 [英] Increase value when i clicking on the button

查看:64
本文介绍了当我点击按钮时增加价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要插入学生的录取表格.
当我单击该按钮时,不需要增加入场人数..
对于不同的插入,它的值将必须增加...

对于示例第一个表单插入单击,AdmNo为:Adm0001
第二种形式的插入点击,AdmNo为:Adm0002
第三种形式的插入点击,AdmNo为:Adm0003 ......
像这样
任何人都可以帮助我

I want to Insert the admission form of a student.
When i insert this from at that click this admission no is need to be increesed..
For different insertion it values will be mustly increesed...

For Example 1st form insertion click, AdmNo is: Adm0001
2nd form insertion click, AdmNo is: Adm0002
3rd form insertion click, AdmNo is: Adm0003......
Like this.
Any one Pls help me

推荐答案

对于问题中指定的要求,我认为可以声明AdmnNo 的公共变量,并且每次单击时其值都会增加按钮,如下所示,并且AdmId 是使用string.Format
生成的
For the requirement specified in the question, I think a public variable for AdmnNo can be declared and its value is incremented in each click of the button as shown below, and the AdmId is generated using string.Format
int AdmnNo = 0;
//Within the click event of the button
string AdmnId = string.Format("Adm{0:0000}",++AdmnNo);
Console.WriteLine (AdmnId);



您必须在表格中设置
将字段AdmNo设置为主键和


将身份规范"设置为是"
IsIdentity为Yes
增量1

右键点击表格-> design
可以看到以上内容

希望对您有帮助
Hi
you have to set in your table
Set the Field AdmNo as Primary Key and


set Identity Specification as Yes
IsIdentity as Yes
Increment By 1

the above can see by right clicking the table->design


hope this help you


这篇关于当我点击按钮时增加价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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