コード例 #1
0
ファイル: frmStock.cs プロジェクト: csaking/Honours-Project
 private void stocksGridLoad()
 {
     try
     {
         ConnectionClass.OpenConnection();
         DataSet StockDS = new DataSet();
         StockDA = new MySqlDataAdapter("SELECT * FROM tblstock", ConnectionClass.con);
         StockDA.Fill(StockDS);
         grdStock.DataSource = StockDS.Tables[0];
     }
     catch (MySqlException e)
     {
         MessageBox.Show("Error contacting the database. Refresh your connection and try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #2
0
ファイル: frmLists.cs プロジェクト: csaking/Honours-Project
 private void listContentLoad()
 {
     try
     {
         ConnectionClass.OpenConnection();
         DataSet ListContentsDS = new DataSet();
         ListContentDA = new MySqlDataAdapter("SELECT * FROM collatedlists", ConnectionClass.con);
         ListContentDA.Fill(ListContentsDS);
         grdListIssues.DataSource = ListContentsDS.Tables[0];
         ConnectionClass.CloseConnection();
     }
     catch (MySqlException e)
     {
         MessageBox.Show("Error contacting the database. Refresh your connection and try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
ファイル: frmSeries.cs プロジェクト: csaking/Honours-Project
 private void publishersGridLoad()
 {
     try
     {
         ConnectionClass.OpenConnection();
         DataSet PublisherDS = new DataSet();
         PublisherDA = new MySqlDataAdapter("SELECT * FROM tblpublisher", ConnectionClass.con);
         PublisherDA.Fill(PublisherDS);
         grdPublisher.DataSource = PublisherDS.Tables[0];
         ConnectionClass.CloseConnection();
     }
     catch (MySqlException e)
     {
         MessageBox.Show("Error contacting the database. Refresh your connection and try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }