如何生成用户定义实验室编号. [英] How To generate user defind lab no.

查看:71
本文介绍了如何生成用户定义实验室编号.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我使用C#.net和后端sql server 2005创建了一个基于窗口的项目(临床实验室管理系统). 这将保留一个来自命名患者的注册,在该患者注册中注册新患者的信息,注册后,我们有两个号码
1.登记号
2.实验室编号

我希望这两个数字都是从数据库自动生成的,但是它们是由用户设置的,例如-
登记号从p001开始
实验室编号从L001开始

表示下一个regno是p002,p003等
实验室里也有同样的情况L002 ............

现在我不知道它是如何从数据库中生成的
据我所知,我让主人来设置这些数字
但是在保存到数据库后它们如何自动递增

提前thanxz
:doh:

hello all

i make a window based project(clinical lab management system) using C#.net and at back end sql server 2005
this will hold a from named patient registration in which information of new patient is registered and after registration we have two numbers
1. reg no.
2. lab no.

i want both these numbers are generated automatically from database but they are set by the user e.g-
reg no. starts from p001
lab no. starts from L001

means next regno is p002,p003 and so on
and same case in lab no also L002............

now i dont know how it is genrated from database
as i know and i made master fro set these numbers
but how they are auto incremental after save in database

thanxz in advance
:doh:

推荐答案

您可以在数据库中使用RegNo和LabNo作为ID字段.保持它为Integer类型,并每次自动递增1. (设置表时,可以很容易地在DB中完成!)

现在,由于它只是固定的字母"P"或"L",请在需要时在查询中获取数据时或在用户界面中使用适合您的UI时附加它们.
You can use RegNo & LabNo as ID fields in your database. Keep it as Integer type and auto-increment by 1 each time. (this can be done in DB very easily while setting up a table!)

Now since, its just the fixed letter ''P'' or ''L'', append that whenever you are using them either in query while fetching data or in UI while using it whereever suits you.


这篇关于如何生成用户定义实验室编号.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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