NET Web应用程序中如何从数据库检索值? [英] How can retreive values from database in .net web application?

查看:67
本文介绍了NET Web应用程序中如何从数据库检索值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用的数据库具有名称,电话号码,id列.在网页中,我使用三个文本框来输入名称,电话号码和id.如果我在textbox1中输入id,则相应的名称和电话号码应显示在textbox2和textbox3中.请给我答案.

谢谢,

Viswanathan.M

Hi,,

I have use database with the columns Name,phoneno,id..And in a web page i use three textboxes for name,phoneno and id.If i give id in textbox1 , the corresponding name and phone no should display in textbox2 and textbox3.Kindly send me the answer.

Thanks ,

Viswanathan.M

推荐答案

基本问题.以下链接将为您提供帮助

点击我 [ ^ ]
Basic Question. following link will help you

Click me[^]


看看下面的链接.

通过C#访问SQL Server的入门指南 [ http://www.akadia.com/services/dotnet_data_reader.html [
Have a look at below links.

Beginners guide to accessing SQL Server through C#[^]

http://www.akadia.com/services/dotnet_data_reader.html[^]


您可以使用ADO.Net来检索数据库中的记录.对于这种情况,您将需要使用SqlCommand,然后添加一个参数,该参数包含要从数据库中检索的记录的ID.了解有关ADO.Net的信息.如果您在Google中进行搜索,则会有很多文章.
You can use ADO.Net to retrieve records from the database. For this scenario, you will need to use a SqlCommand and then add a parameter that contains the id of the record you are going to retrieve from the database. Read about ADO.Net. There are a lot of articles if you search in Google.


这篇关于NET Web应用程序中如何从数据库检索值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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