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

问题描述

我在C#网站的调试中遇到问题,无法在此代码中找到表0



I'' am getting the problem in debug in C# web site is cannot find table 0 on this code



using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using ORCMS.DAL;
using ORCMS.Entity;
public partial class Admin_ResourceRegister : System.Web.UI.Page
{
    string war, amc;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ControlBinder.BindDepartments(dpdldept);
            ControlBinder.BindEmployee(dpdlUserName);
            ControlBinder.BindResourceCategory(dpdlCategory);
        }
    }
    protected void dpdlCategory_SelectedIndexChanged(object sender, EventArgs e)
    {
        ControlBinder.BindResourceType(dpdlType, dpdlCategory);
    }
    protected void btnclear_Click(object sender, EventArgs e)
    {
        txtResourceName.Text = string.Empty;

        dpdlCategory.SelectedItem.Value = string.Empty;
        dpdlType.SelectedItem.Value = string.Empty;
        dpdlUserName.SelectedItem.Value = string.Empty;
        txtconfig.Text = string.Empty;
        txtipadd.Text = string.Empty;
        txtUsedFor.Text = string.Empty;
        dpdldept.SelectedItem.Value = string.Empty;
        txtregdate.Text = string.Empty;


    }

    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        ResourceRegistration oResReg = new ResourceRegistration();
        DALResorceRegistration oDALResReg = new DALResorceRegistration();

        string sError=string.Empty;
        if (rdbWarNo.Checked == true)
        {
            war = rdbWarNo.Text;
        }
        else
        {
            war = rdbWarYes.Text;
        }
        if (rdbAMCNo.Checked == true)
        {
            amc = rdbAMCNo.Text;
        }
        else
        {
            amc = rdbAMCYes.Text;
        }

        try
        {
            oResReg.Config = txtconfig.Text;
            oResReg.DeptID = Convert.ToInt32(dpdldept.SelectedItem.Value);
            oResReg.IpAdd = txtipadd.Text;
            oResReg.RegDate = Convert.ToDateTime(txtregdate.Text);
            oResReg.ResType = dpdlType.SelectedItem.Value;
            oResReg.RseName = txtResourceName.Text;
            oResReg.UsedFor = txtUsedFor.Text;
            oResReg.UserID = Convert.ToInt32(dpdlUserName.SelectedItem.Value);
            oResReg.AMC = amc;
            oResReg.warranty = war;
            DataSet oDsResult = oDALResReg.InsertResourceDetails(oResReg, ref sError);
            if (oDsResult != null && oDsResult.Tables != null &&
                oDsResult.Tables[0].Rows.Count > 0 &&
                oDsResult.Tables[0].Rows[0]["RC"].ToString().Equals("0"))
            {
                txtconfig.Text = string.Empty;
                txtipadd.Text = string.Empty;
                txtregdate.Text = string.Empty;
                txtResourceName.Text = string.Empty;
                txtUsedFor.Text = string.Empty;
                dpdlCategory.SelectedIndex = dpdldept.Items.IndexOf(
                dpdldept.Items.FindByValue("Select"));
                dpdldept.SelectedIndex = dpdldept.Items.IndexOf(
                dpdldept.Items.FindByValue("Select"));
                dpdlType.SelectedIndex = dpdldept.Items.IndexOf(
                dpdldept.Items.FindByValue("Select"));
                dpdlUserName.SelectedIndex = dpdldept.Items.IndexOf(
                dpdldept.Items.FindByValue("Select Employee Name"));
                lblServerMsg.Text = oDsResult.Tables[0].Rows[0]["ServerMsg"].ToString();
            }
            else
            {
                lblServerMsg.Text = oDsResult.Tables[0].Rows[0]["ServerMsg"].ToString();
            }
        }
        catch (Exception oEx)
        {
            lblServerMsg.Text = oEx.Message;
        }
    }

推荐答案


这篇关于在运行模式下找不到表0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:10