private void CustomerTransactionReportForm_Load(object sender, EventArgs e) { ReportDocument cryRpt; using (Devart.Data.SQLite.SQLiteConnection myConn = new Devart.Data.SQLite.SQLiteConnection(myConfig.connstr)) { using (SQLiteCommand myCmd = new SQLiteCommand(sqlcmd, myConn)) { myConn.Open(); using (SQLiteDataReader myReader = myCmd.ExecuteReader()) { dataSet2.customer_trans.Load(myReader); myConn.Close(); } } } this.customerTableAdapter1.Fill(this.dataSet2.customer); this.configurationTableAdapter1.Fill(this.dataSet2.configuration); CustomerTransactionReport rpt = new CustomerTransactionReport(); rpt.SetDataSource(this.dataSet2); cryRpt = new ReportDocument(); cryRpt.Load(rpt.FileName.ToString()); cryRpt.SetDataSource(this.dataSet2); cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\CustomerTransactions.pdf"); }
static void Main(string[] args) { string sourceFile = null; string output = null; DbConnection connection = null; bool dump = false; try { if (args.Length == 0) { Usage("No arguments specified!"); return; } for (var i = 0; i < args.Length; i++) { var arg = args[i]; switch (arg.ToLower()) { case "-sourcefile": sourceFile = args[++i]; if (!File.Exists(sourceFile)) Usage("source file does not exist or is an invalid path."); break; case "-output": output = args[++i]; break; case "-dump": dump = true; break; default: Usage("Incorrect option specified."); return; } } } catch (Exception ex) { Usage(ex.Message); } Devart.Data.SQLite.Entity.Configuration.SQLiteEntityProviderConfig.Instance.Workarounds.IgnoreSchemaName = true; connection = new Devart.Data.SQLite.SQLiteConnection(string.Format("Data Source='{0}';FailIfMissing=False", output)); Console.WriteLine("populating database..."); Import(sourceFile, connection); if (dump) { Console.WriteLine("displaying data names..."); Dump(connection); } Console.WriteLine("done."); }