问题描述
privatevoidbutton1添加_Click(objectsender,EventArgse){thisDataSet.Clear();thisConnection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=日常事务日志.mdb";OleDbDataAdapterthisAdapter=newOleDbDataAdapter("SELECT*FROM下载文章记录",thisConnection);OleDbCommandBuilderthisBuilder=newOleDbCommandBuilder(thisAdapter);thisAdapter.Fill(thisDataSet,"下载文章记录");DataRowthisRow=thisDataSet.Tables["下载文章记录"].NewRow();thisRow["日期"]=this.dateTimePicker1.Value;thisRow["待下载的文章"]=this.textBox1.Text;thisDataSet.Tables["下载文章记录"].Rows.Add(thisRow);thisAdapter.Update(thisDataSet,"下载文章记录");thisConnection.Close();}privatevoid有待下载的文章ToolStripMenuItem_Click(objectsender,EventArgse){try{this.下载文章记录TableAdapter.FillByNotDownloadandRead(this.日常事务日志DataSet.下载文章记录);}catch(System.Exceptionex){System.Windows.Forms.MessageBox.Show(ex.Message);}}当“button1添加_Click”执行后,“有待下载的文章ToolStripMenuItem_Click”的数据检索功能就不起作用了(“button1添加_Click”不执行时,“有待下载的文章ToolStripMenuItem_Click”的数据检索功能是可用的),这是为什么呢?
解决方案
解决方案二:
是不是用了两个dataset的缘故呢?
解决方案三:
高手快快出来看看啊