在显示中找不到表0. [英] Cannot find table 0. in display

查看:140
本文介绍了在显示中找不到表0.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到表0.

张贴于:2013年7月23日

这是我的显示功能它显示错误找不到表0.



Cannot find table 0.
Posted on: 23 Jul 2013
this is my display function it shows error Cannot find table 0.

public void display()
   {

           DataSet ds = new DataSet();
           ds = DB.ExecuteQuery_SP("displayDetails");
           GridView1.DataSource = ds.Tables[0];
           GridView1.DataBind();

protected void btnSave_Click(object sender, EventArgs e)
   {
       ThreadStart DisplayThread = new ThreadStart(display);
       Thread t2 = new Thread(DisplayThread);
       t2.Start();
       display();


       ThreadStart InsertionThread = new ThreadStart(insertion);
       Thread t1 = new Thread(InsertionThread);
       t1.Priority = ThreadPriority.Highest;
       t1.Start();
       //insertion();

       ThreadStart MailThread = new ThreadStart(Mail);
       Thread t3 = new Thread(MailThread);
       t3.Start();
       //Mail();
       display();
       DataSet ds = new DataSet();
       ds = DB.ExecuteQuery_SP("displayDetails");
       GridView1.DataSource = ds.Tables[0];
       GridView1.DataBind();

推荐答案

嗨Shamsheer,



我希望,您正在调用的商店程序不会保留您要显示的结果。

我建议您在从表[0]读取数据之前添加此条件。就像这样



Hi Shamsheer,

I hope, the store procedure that you are calling does'nt hold the results that you are intended to display.
I suggest you to add this condition before reading data from table[0].Like this

public void display()
        {
           DataSet ds = new DataSet();
           ds = DB.ExecuteQuery_SP("displayDetails");
           if (ds.Tables.Count > 0 )
           {
               GridView1.DataSource = ds.Tables[0];
               GridView1.DataBind();
           }
        }



否则你可以参考这个链接 [ ^ ]

我希望这对你有所帮助。



谢谢,

RK


else you can refer this link[^]
I hope this could help you a bit.

Thanks,
RK


这篇关于在显示中找不到表0.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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