且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

根据数据库验证文本框值

更新时间:2022-03-19 23:26:08

首先,您需要向我们展示您的尝试,以便我们可以帮助您将流程分解为适当的步骤.
如果您付出一些努力,您会惊讶于您的无所不能.当您遇到困难时,我们会在这里鼓励和指导您,但只为您提供剪切和粘贴的答案不会对我们或您有任何帮助.
First off you need to show us what you have tried so that we can help you with how to break down the process into appropriate steps.
You''ll be amazed at what you can do if you put in some effort. We''re here to encourage and instruct you when you run into difficulties, but it won''t help us or you at all to just give you a cut and paste answer.


您的这个问题太笼统了.您应该首先研究如何从所使用的特定数据库访问数据.您可以找到许多代码项目文章 [ google. [
Your question is too general. You should start by researching how to access data from the specific database you are using. You can find many code project articles[^] on the subject. Another good way to start is to use google.[^]

Once you''ve gotten started, if you have a more specific question come on back and post it with the relevant code you''re working with and you will get a lot more help.


Re:如果数据库中存在值,则允许用户输入该值

为什么不只是使用一个填充有数据库可接受输入值的下拉列表,那么您将知道该值存在于数据库中,并且用户将无法输入不可接受的值.
Re: if value exists in database, user is allowed to input that value

why not just use a dropdownlist populated with acceptable input values from the database, then you will know the value exists in the database and the user won''t be able input unacceptable values.