title: how to import Excel file data into SQLite database in c# windows form?
body: <p>I am trying to import excel file data into SQLite database. I used 2 buttons, import and save button.</p>
  <p>Here is the code of import button, in which i tried to get file from given path and loading file data into datagridview.</p>
  <pre><code>    private void import_btn_Click(object sender, EventArgs e)
          {
              string fileName= @&quot;C:\Users\***\Documents\Customers.xlsx&quot;;
              Workbook workbook = new Workbook();
              workbook.LoadFromFile(fileName);
              Worksheet sheet = workbook.Worksheets[0];
              this.dataGridView1.DataSource = sheet.ExportDataTable();
          }
  </code></pre>
  <p>And here i am importing data into SQLite database table.</p>
  <pre><code>      private void save_btn_Click(object sender, EventArgs e)
          {
              string code = &quot;C-0002&quot;;
              SQLiteConnection Con = new SQLiteConnection(&quot;Data Source=|DataDirectory|JDS_DB.sqlite&quot;);
              SQLiteCommand com;
              string str;
              Con.Open();
              for (int index = 0; index &lt; dataGridView1.Rows.Count - 1; index++)
              {
                  str = &quot;insert into Customers(Name,Code,Group_,Address,Phone,Cell,Email_Address,Date,Opening_balance)values(@Name,@Code,@Group_,@Address,@Phone,@Cell,@Email_Address,@Date,@Opening_balance)&quot;;
                  com = new SQLiteCommand(str, Con);
                  com.Parameters.AddWithValue(&quot;@Name&quot;, dataGridView1.Rows[index].Cells[0].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Code&quot;,code);
                  com.Parameters.AddWithValue(&quot;@Group_&quot;, dataGridView1.Rows[index].Cells[1].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Address&quot;, dataGridView1.Rows[index].Cells[2].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Phone&quot;, dataGridView1.Rows[index].Cells[3].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Cell&quot;, dataGridView1.Rows[index].Cells[4].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Email_Address&quot;, dataGridView1.Rows[index].Cells[5].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Date&quot;, dataGridView1.Rows[index].Cells[6].Value.ToString());
                  com.Parameters.AddWithValue(&quot;@Opening_balance&quot;, dataGridView1.Rows[index].Cells[7].Value.ToString());
                  com.ExecuteNonQuery();
                  MessageBox.Show(&quot;added&quot;);
              }
              Con.Close();
          }
  </code></pre>
  <p><strong>PROBLEM:</strong></p>
  <p>Its working properly, but i want to read data from excel and directly import it in database table, instead of using datagridview. If anyone know how to do it, kindly let me know, Thank you</p>