从表格呼叫数据到文本 [英] Call data from Table to Text

查看:84
本文介绍了从表格呼叫数据到文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我正在开发桌面应用程序.

我想从表中调用数据并显示在文本框中,如下所示.

txtamt.Text = drSQL.Item("amount").ToString()

这样一来就可以定义每个文本框中的每个字段.

当字段超过40至50个字段时,就会发生此问题.

pl指南如何减少代码....

谢谢


Jatinder Gupta

Dear all,

I''m developing a desk top application.

I want to call the data from the table and display in the text box as under.

txtamt.Text = drSQL.Item("amount").ToString()

In that way to define each field in each text box one by one.

The problem occures when the field are more that 40 to 50 fields.

Pl guide how to reduce the code....

Thanks


Jatinder Gupta

推荐答案

为什么不使用数据集以及数据绑定!?

您可以拥有一个数据集,将数据加载到其中,并将Databindings.Text设置为合适的列名.

这是一个例子:
http://www.akadia.com/services/dotnet_databinding.html [
why dont you use datasets, along with databindings!?

you can have a dataset, load your data in it, and set Databindings.Text to suitable column name.

here is an example :
http://www.akadia.com/services/dotnet_databinding.html[^]

-----------------------
Regards

H.Maadani


这篇关于从表格呼叫数据到文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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