我想检查插入的Texbox值在数据库表中是否可用 [英] i want to check the inserted Texbox values is available in database table or not

查看:48
本文介绍了我想检查插入的Texbox值在数据库表中是否可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查文本框中插入的值是否在数据库表中可用.代码在vb.net和Sql服务器数据库中. 请帮助我某人

i want to check the inserted values in Text Box is available in database Table or not.the code is in vb.net and Sql server database.
plz help me someone

推荐答案

尝试:
1.使用ADO.NET与数据库对话并检索信息
2.使用查询找出存在.这样的例子之一:
Try:
1. Use ADO.NET to talk to database and retrieve the information
2. Use query to find out the existence. One such example:
-- See if any row returned?
SELECT * FROM MyTable WHERE ValueToCheck = @SeeIfThisValueExists



这些将有助于:
MSDN:ADO.NET [ MSDN:使用ADO.NET访问数据 [ ^ ]

学习和尝试.如果遇到问题,请提出具体问题.



These would help:
MSDN: ADO.NET[^]
MSDN: Accessing Data with ADO.NET[^]

Learn and try. If you get stuck, ask specific issue.


如果使用命令,则实际上可以从命令中检查返回值.
例如
If you are using commands, you can actually check for the return value from the command.
E.g.
//id will contain the inserted value.
int id = Convert.ToInt32(cmd.ExecuteScalar() );


这篇关于我想检查插入的Texbox值在数据库表中是否可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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