using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace textroot
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.dataGridView1.Dock = DockStyle.Fill;
            //创建数据集对象
            DataSet1.Datatable1DataTable tempTable = new DataSet1.Datatable1DataTable();
            //填充数据集
            this.dataTable1TableAdapter.Fill(tempTable);
            //数显控制
            this.dataGridView1.DataSource = tempTable;        }
错误 1 “textroot.Form1”不包含“dataTable1TableAdapter”的定义,并且找不到可接受类型为“textroot.Form1”的第一个参数的扩展方法“dataTable1TableAdapter”(是否缺少 using 指令或程序集引用?) F:\My Docments\Visual Studio 2008\Projects\textroot\textroot\Form1.cs 20 18 textroot我问我们老师,老师给我说要添加到命名空间,我是初学,对于using指令 和一些C#的代码不太熟悉。

解决方案 »

  1.   

    没有dataTable1TableAdapter对象,你在哪定义的dataTable1TableAdapter
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
      

  2.   

    我一句话说不清楚,能否留下MSN 或者QQ
    我的MSN [email protected]
      

  3.   

    dataTable1TableAdapter没找到定义啊,你在这里说问题就是了,会有高手帮你的。
      

  4.   

    在你的项目中右击添加引用,找到你要引用的东西添加,然后在代码编辑页面中using XXXXXX;