错误数据集代码在哪里 [英] Where is The Error Dataset Code

查看:71
本文介绍了错误数据集代码在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

namespace Company.Project.DataProvider
{
    partial class MyDataSet
    {
        partial class MyDataTable
        {
        }
    }
}
namespace Company.Project.DataProvider.MyDataSetTableAdapters
{
    public partial class MyTableAdapter
    {
        public int CommandTimeout
        {
            set
            {
                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1))
                {
                    if ((this.CommandCollection[i] != null))
                    {
                        this.CommandCollection[i].CommandTimeout = value;
                    }
                }
            }
        }
    }
}


protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
       {
           Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter adapter;
           adapter = (Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter)e.ObjectInstance;
           // Set command timeout to 2 minutes
           adapter.CommandTimeout = 120;

       }


错误在哪里

ERROR MESSAGE:<br />
The type or namespace name ''Company'' could not be found (are you missing a using directive or an assembly reference?)

解决方案

确保在包含ObjectDataSource_ObjectCreating方法的项目中已包含名称空间Company.Project.DataProvider.MyDataSetTableAdapters的程序集.


namespace Company.Project.DataProvider
{
    partial class MyDataSet
    {
        partial class MyDataTable
        {
        }
    }
}
namespace Company.Project.DataProvider.MyDataSetTableAdapters
{
    public partial class MyTableAdapter
    {
        public int CommandTimeout
        {
            set
            {
                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1))
                {
                    if ((this.CommandCollection[i] != null))
                    {
                        this.CommandCollection[i].CommandTimeout = value;
                    }
                }
            }
        }
    }
}


protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
       {
           Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter adapter;
           adapter = (Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter)e.ObjectInstance;
           // Set command timeout to 2 minutes
           adapter.CommandTimeout = 120;

       }


Where is the error

ERROR MESSAGE:<br />
The type or namespace name ''Company'' could not be found (are you missing a using directive or an assembly reference?)

解决方案

Make sure you have included the assembly for namespace Company.Project.DataProvider.MyDataSetTableAdapters in the project that contains ObjectDataSource_ObjectCreating method.


这篇关于错误数据集代码在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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