我们如何在不读取DataGridview的情况下在数据库中显示信息? [英] How can we display the information in the database without having to read from DataGridview?

查看:97
本文介绍了我们如何在不读取DataGridview的情况下在数据库中显示信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不显示在DataGridview中的情况下使用数据库中的信息?

例如:

How can we use the information in the database without display in the DataGridview?

For example:

me.text=DataGridview.Item(0,0).Value



我们无需使用DataGridview即可获得此信息.

基本上我想知道
是否可以在表中调用单元格?(没有datagridview)

tanX



We get this information without use DataGridview.

Basically I want to know
Whether we can call cell in a table or not?(without datagridview)

tanX

推荐答案

DataGrid只是检索和显示数据的一种简单方法(快捷方式").当然,您可以不使用DataGrid而连接到数据库并检索数据:只需使用DataSet s和DataTable s.
周围有许多教程,例如:数据集和数据适配器" [ ^ ].
DataGrid is just a simple way (a ''shortcut'') for retrieving and displaying data. Of course you may connect to the database and retrieve data without using a DataGrid: just use DataSets and DataTables.
There are many tutorial around, see, for instance: "Data Sets and Data Adapters"[^].


不知何故我感觉到您正在谈论绑定...
您可以绑定到文本框,就像可以绑定到DataGridViews一样.
Somehow I get a feeling you are talking about binding...
You can bind to Textboxes just like you can bind to DataGridViews.
TextBox1.Bindings.Add("Text", MyDataSourceObject, "MyDataSourceProperty")

或者,您可以从属性"网格中添加绑定.寻找(DataBindings).
它称为简单绑定.
.NET Windows窗体中的数据绑定概念 [

Alternatively you can add Bindings from the Property Grid. Look for (DataBindings).
It is called Simple Binding.
Data binding concepts in .NET windows forms[^]

Alternatively, without binding, you could simply fetch a DataRow from your database and pretty much assign a columns value to your TextBox.Text Property.


这篇关于我们如何在不读取DataGridview的情况下在数据库中显示信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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