![]() ![]() String sql = "create table MyData (Party varchar(20), BillNo varchar(20), BillDate varchar(20) ,Amount varchar(20) ,DueDate varchar(20),PaidOn varchar(20)) " SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=MyDatabase.sqlite") SQLiteConnection.CreateFile("MyDatabase.sqlite") You could try to refer to the code below. I've even tried doing the date filter like SQLiteCommand command = new SQLiteCommand("SELECT * FROM ExcelData WHERE DueDt BETWEEN '' AND ''", conn) but that doesn't work either.Īlso, the amount column does not show 2 decimal points when I see it in Datagrid. SQLiteDataAdapter adap = new SQLiteDataAdapter(command) ĭataTable dt = new DataTable("ExcelData") SQLiteCommand command = new SQLiteCommand("SELECT * FROM ExcelData WHERE DueDt >= date('now') AND DueDt < date('now','100 days')", conn) My first question is whether the above method can be made faster/more efficient and less error prone like SQL injection issues and/or database read-write, sudden loss of connection to database error ?įurther, when I try to filter the database by date filter like below, I get a blank Datagrid : using(SQLiteConnection conn= new Source=" Path.GetFullPath("./TestDB.db") " ")) I created a database TestDB.db with table ExcelData using DB browser for SQLite as below ![]() Using (ExcelPackage excelPackage = new ExcelPackage(new System.IO.FileInfo(xlFile), false))ĮxcelWorksheet worksheet = () įor (int i = 1 i row.Field(5)) Right now I'm using the below method(using EPPlus for workbook manipulation): public void Excel2DB() You can read the article How To Add Library In Python Eclipse Project to learn more.I want to import data from a excel workbook/worksheet to a SQLite database table. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |