[Quantproject-developers] QuantDownloader/Downloader WebDownloader.cs, 1.22, 1.23
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-12-30 00:19:10
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17910/Downloader Modified Files: WebDownloader.cs Log Message: Now both Access and MySql are supported Index: WebDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/WebDownloader.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** WebDownloader.cs 30 Nov 2008 22:52:04 -0000 1.22 --- WebDownloader.cs 30 Dec 2008 00:18:53 -0000 1.23 *************** *** 5,9 **** using System.Windows.Forms; using System.Data; ! using System.Data.OleDb; using System.Net; using System.IO; --- 5,9 ---- using System.Windows.Forms; using System.Data; ! using System.Data.Common; using System.Net; using System.IO; *************** *** 22,26 **** public class WebDownloader : System.Windows.Forms.Form, ITickerSelector { ! public OleDbConnection OleDbConnection1 = ConnectionProvider.OleDbConnection; public System.Windows.Forms.DataGrid dataGrid1; private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; --- 22,26 ---- public class WebDownloader : System.Windows.Forms.Form, ITickerSelector { ! // public DbConnection DbConnection1 = ConnectionProvider.DbConnection; public System.Windows.Forms.DataGrid dataGrid1; private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; *************** *** 29,33 **** private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1; private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1; - private System.Data.OleDb.OleDbCommand oleDbCommand1; public DataSet1 DsTickerCurrentlyDownloaded = new DataSet1(); private System.Windows.Forms.Button buttonDownloadQuotesOfSelectedTickers; --- 29,32 ---- *************** *** 129,133 **** { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebDownloader)); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter(); --- 128,131 ---- *************** *** 136,140 **** this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand(); this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand(); - this.oleDbCommand1 = new System.Data.OleDb.OleDbCommand(); this.buttonDownloadQuotesOfSelectedTickers = new System.Windows.Forms.Button(); this.dateTimePickerStartingDate = new System.Windows.Forms.DateTimePicker(); --- 134,137 ---- *************** *** 183,187 **** // oleDbDeleteCommand1 // - this.oleDbDeleteCommand1.CommandText = resources.GetString("oleDbDeleteCommand1.CommandText"); this.oleDbDeleteCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] { new System.Data.OleDb.OleDbParameter("Original_quId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(10)), ((byte)(0)), "quId", System.Data.DataRowVersion.Original, null), --- 180,183 ---- *************** *** 218,222 **** // oleDbUpdateCommand1 // - this.oleDbUpdateCommand1.CommandText = resources.GetString("oleDbUpdateCommand1.CommandText"); this.oleDbUpdateCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] { new System.Data.OleDb.OleDbParameter("quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((byte)(7)), ((byte)(0)), "quClose", System.Data.DataRowVersion.Current, null), --- 214,217 ---- *************** *** 240,248 **** new System.Data.OleDb.OleDbParameter("Original_quTicker1", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)}); // - // oleDbCommand1 - // - this.oleDbCommand1.CommandText = "DELETE quotes.* FROM quotes INNER JOIN tickers ON quotes.quTicker = tickers.tiTic" + - "ker"; - // // buttonDownloadQuotesOfSelectedTickers // --- 235,238 ---- *************** *** 580,597 **** private void openDbAndSetOleDbCommand() { ! try ! { ! if (this.OleDbConnection1.State != ConnectionState.Open) ! this.OleDbConnection1.Open(); ! oleDbCommand1.Connection = this.OleDbConnection1; ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! } ! finally ! { ! this.OleDbConnection1.Close(); ! } } --- 570,587 ---- private void openDbAndSetOleDbCommand() { ! // try ! // { ! // if (this.DbConnection1.State != ConnectionState.Open) ! // this.DbConnection1.Open(); ! // oleDbCommand1.Connection = this.DbConnection1; ! // } ! // catch(Exception ex) ! // { ! // MessageBox.Show(ex.ToString()); ! // } ! // finally ! // { ! // this.DbConnection1.Close(); ! // } } |