using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace SMS
{
    public partial class frmMyOrder : Form
    {
        public frmMyOrder()
        {
            InitializeComponent();
        }
        public string adminname;
        private void frmMyOrder_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“db_SMSDataSet.tb_tel”中。您可以根据需要移动或移除它。
            this.tb_telTableAdapter.Fill(this.db_SMSDataSet.tb_tel);
            SetMyData();
        }
        private void SetMyData()
        {
            
            OleDbConnection conn = BaseClass.ConnClass.DataConn();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from tb_tel where UserName='" + adminname + "'", conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            dgvMyUser.DataSource = ds.Tables[0];        } 
    }
}
这个逻辑性是没错 但是貌似没输出 

解决方案 »

  1.   

    已经加载好了,不须自己写加载啊
    dgvMyUser.DataSource = tb_telBindingSource;
    tb_telBindingSource这个应该有
    或者:详情编辑.DataSource = this.db_SMSDataSet.tb_tel;
    DataTable 名称 = db_SMSDataSet.tb_tel;
      

  2.   

    已经加载好了,不须自己写加载啊
    dgvMyUser.DataSource = tb_telBindingSource;
    tb_telBindingSource这个应该有
    或者:dgvMyUser.DataSource = this.db_SMSDataSet.tb_tel;
    DataTable 名称 = db_SMSDataSet.tb_tel;
      

  3.   

    // TODO: 这行代码将数据加载到表“db_SMSDataSet.tb_tel”中。您可以根据需要移动或移除它。
      this.tb_telTableAdapter.Fill(this.db_SMSDataSet.tb_tel);这句好像多此一举吧!