在显示gridview时需要帮助 [英] need help in displying gridview

查看:60
本文介绍了在显示gridview时需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我编写了以下代码,用于在gridview中绑定和显示数据

Hi all

i wrote the below code for binding and displaying the data in gridview

try
        {
 //       int searchstring;
        string qry = "SELECT question_bank.question, question_bank.answer,question_bank.subject, question_bank_1.docname,question_bank_1.year FROM question_bank INNER JOIN question_bank_1 ON question_bank.qno=question_bank_1.qno where question_bank_1.question like ' %"+ TextBox1.Text +" %' ORDER BY question_bank_1.qno";
        DataSet ds = db.upDataset(qry);
        GridView1.Visible = true;
        GridView1.DataSource = ds;
        GridView1.DataBind();
        }
       catch(Exception ex)
        {
        }



代码中没有错误,但最后它没有显示gridview ..请告诉我我要去哪里了...



there is no error in the code but at end it not showing the gridview..please tell me where i am going wrong...

推荐答案

ds应该更改为ds .Tables [0]
ds should changed to ds.Tables[0]


这篇关于在显示gridview时需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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