使用Windows应用程序将列数据库中的数据库绑定到csharp中的数据网格视图 [英] Binding column form data base to data grid view in csharp using windows application

查看:58
本文介绍了使用Windows应用程序将列数据库中的数据库绑定到csharp中的数据网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库如下;



sno int

教师代码varchar

教师姓名varchar

Mobileno varchar

活动字符(1)



保存数据库记录。



使用数据网格视图设计屏幕如下;



日期会话RV MS TS CNN UNNI VB Gs



8/1/2013 1

8/1/2013 2

8/1/2013 3



列为RV MS TS CNN UNNI VB Gs从数据库中检索。

RV MS TS CNN UNNI VB Gs以上是教员姓名。从数据库中检索该教员名称并绑定到数据网格视图。



i希望从数据库中获取教师姓名并输入数据网格视图列。



表示如何编写代码。

Data base as follow;

sno int
faculty code varchar
Faculty name varchar
Mobileno varchar
Active char(1)

in that data base records are saved.

Designing Screen as follows using Data Grid View;

Date Session RV MS TS CNN UNNI VB Gs

8/1/2013 1
8/1/2013 2
8/1/2013 3

the column as RV MS TS CNN UNNI VB Gs as retrieved from the data base.
RV MS TS CNN UNNI VB Gs the above are the faculty name.that faculty name is retrieved from the data base and bind in to the data grid view.

i want to get the faculty name from the data base and put in to the data grid view column.

for that how to write the code.

推荐答案

您只需运行SQL即可获取所需数据,将其分配给网格并调用DataBind
You just run the SQL to get the data you want, assign it to the grid and call DataBind


这篇关于使用Windows应用程序将列数据库中的数据库绑定到csharp中的数据网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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