将数据源从.cs文件绑定到gridview [英] bind datasource to gridview from .cs file

查看:104
本文介绍了将数据源从.cs文件绑定到gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
这是我的问题:
我想使用DataAccess类将数据源提供给Grid View.并使用该类中的函数来更新,删除数据库中的数据.
请帮助我.....
谢谢
Bilal Hassan

Hey every one.
here is my question:
i want to use my DataAccess class to give data source to Grid View. and use functions in that class to update, delete data in database.
plz help me.....
Thanks
Bilal Hassan

推荐答案

Gridview仅需要数据源,仅此而已.因此,将数据集或数据表或其他内容传递给GridView
Gridview just need the Datasource, that''s all. So pass the Dataset or DataTable or something to GridView
GridView.DataSource = dDataSource;//Assign the Datasource here

GridView.Databind();



编辑
----------------------------

插入,更新和使用网格视图删除 [插入更新编辑删除GridView中的记录 [



EDIT
----------------------------

Insert,Update and Delete Using Grid View[^]
Insert Update Edit Delete record in GridView[^]


除了 Raja 灵魂之外,我还建议您浏览给定的链接以获取Gridview中插入,更新和删除数据的完整步骤
在Gridview中编辑,更新,删除 [
In addition to Raja soultion I am also suggesting you to navigate given link to get full steps for Insert,Update and Delete data in Gridview
Edit,Update,Delete in Gridview[^]


这篇关于将数据源从.cs文件绑定到gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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