各位大牛,请教了。
我在窗体中有个按钮toolStripButton执行,当它的按钮事件触发时,调用toolStripButton执行_Click(object sender, EventArgs e)方法,并在同窗体中dataGridView中填充数据,并且在Student表中是有数据的。但偏偏只出现Student的属性名字段,而不显示实际的内容。请教原因了,下面是我的代码。有付截图!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace myDB2
{
    public partial class InputScoreBatchingForm : Form
    {
        string myConnectionString = new myDB2.Properties.Settings().StudentScoreConnectionString;
        OleDbConnection myConnection;
        DataSet myDataSet = new DataSet();
        OleDbDataAdapter myAdapter;
        public InputScoreBatchingForm()
        {
            InitializeComponent();  
            myConnection = new OleDbConnection(myConnectionString);
            myAdapter = new OleDbDataAdapter("select * from Student", myConnection);   
        }

        private void toolStripButton执行_Click(object sender, EventArgs e)
        {
            myConnection.Open();            
                myAdapter.Fill(myDataSet); 
            myConnection.Close();

            dataGridView1.DataSource = myDataSet.Tables[0];
        }

    }
}