如何使用C#将asp.net中的网格视图值更新到数据库? [英] how to update the grid view values to database in asp.net using C# ?

查看:78
本文介绍了如何使用C#将asp.net中的网格视图值更新到数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发人员,

我创建了一个gridview,因为我检索了我的学生的姓名和贝塞德,并勾选了一个复选框,

每当我选中复选框并单击更新"按钮时,

学生班的价值将增加一.

例如,如果某个学生在IX班级,则该学生应晋升为X班级.
谢谢你.

最好的问候,

Thiru

Hi developers,

i created a gridview, in that i retrived the student names and besids that i put a check box,

when ever i check the check box and click on the Update button,

the value of student class will be incremented by one.

example if a student is in IX class that student should be Promoted to X class.

Thank u.

Best Regards,

Thiru

推荐答案

问题尚不清楚,
如果要更新网格视图单元格中的值,则可以在网格视图更新事件处理程序中进行.

选择网格视图并选择属性,您可以在第二个选项卡中看到网格视图的事件.
questions is not clear,
if you want to update the value in grid view cell you can do it in grid view update event handler.

select the grid view and choose the properties, you can see the events of grid view in second tab.


您的问题是否已解决???如果不是这样,请尝试在网格的更新事件下更新数据源,然后将其绑定.
is your problem solved ??? if not so, try to update the data source under your update event of grid then once gain bind it.


我也有类似的担忧,但是在这个级别上,我想显示excell 5000条记录在网格视图中,然后单击一个按钮,这些值将保存在sql server数据库中.
这是显示代码

private void button3_Click(对象发送者,EventArgs e)
{
DialogResult dr = this.openFileDialog1.ShowDialog();
如果(dr == System.Windows.Forms.DialogResult.OK)
{
字符串connectionString = String.Format(@"Provider = Microsoft.Jet.OLEDB.4.0; Data
Source = {0};扩展属性=" Excel
8.0; HDR = YES; IMEX = 1;",openFileDialog1.FileName);
字符串查询= String.Format(从[{0}
i have some similar concern, but at this level i want to display excell 5000 records in grid view and on click a button, these values to save in sql server database.
this is the display code

private void button3_Click(object sender, EventArgs e)
{
DialogResult dr = this.openFileDialog1.ShowDialog();
if (dr == System.Windows.Forms.DialogResult.OK)
{
string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source={0};Extended Properties=""Excel
8.0;HDR=YES;IMEX=1;""", openFileDialog1.FileName);
string query = String.Format("select * from [{0}


这篇关于如何使用C#将asp.net中的网格视图值更新到数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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