找不到表0错误

编程入门 行业动态 更新时间:2024-10-18 18:17:17
本文介绍了找不到表0错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

下面的代码是通过文本框值搜索gridview。相同的代码在其他形式下工作正常。但目前的形式并不起作用。请帮忙。 P.S: - 我的sp工作正常。我查了一下 Thnx .. :) 我尝试了什么:

The below piece of code is for search gridview via textbox value.the same code works fine in other form. but doesnt work in current form. please help. P.S:- My sp works fine. i checked it Thnx.. :) What I have tried:

protected void btnsearch_Click(object sender, System.EventArgs e) { lblWarningMessage.Text = ""; try { if (!string.IsNullOrEmpty(txtSearch.Text)) { GVEquipmentAttribute.Visible = true; DataSet dsSite = new DataSet(); ArrayList arrparam1 = new ArrayList(); arrparam1.Add(txtSearch.Text.Trim()); dsSite = objDB.ExecProc_getDataSet("D_SP_GET_EquipmentAttribute_GRID_Search", arrparam1); DataTable dt = new DataTable(); if (dsSite.Tables[0].Rows.Count > 0) { //btnDelete.Visible = True } else { //btnDelete.Visible = False } dt = dsSite.Tables[0]; GVEquipmentAttribute.DataSource = dt; GVEquipmentAttribute.DataBind(); } else { BindGrid(); }

推荐答案

将其修改为 Modify it as DataTable dt = new DataTable(); dsSite = objDB.ExecProc_getDataSet("D_SP_GET_EquipmentAttribute_GRID_Search", arrparam1); if (dsSite != null && dsSite.Tables.Count > 0) { dt = dsSite.Tables[0]; if (dt.Rows.Count > 0) { //btnDelete.Visible = True } else { //btnDelete.Visible = False } } GVEquipmentAttribute.DataSource = dt; GVEquipmentAttribute.DataBind();

更多推荐

找不到表0错误

本文发布于:2023-07-04 17:14:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1026936.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!