error in exporting textbox text to excel sheet
<p>I'm trying to export some values in textboxes to several columns (Date, Temperature) in an excel sheet (.xlsx file). But it generates an error called "the INSERT INTO statement contains the following unknown field name: 'Temperature'". And when i remove the Temperature column from INSERT INTO statement, it works. Please help. I have given the codings beow:</p>

<pre><code>     private void button2_Click(object sender, EventArgs e)
    {
        openFileDialog2.ShowDialog();
        string Path = openFileDialog2.FileName.Replace("'\'", "'\\'");
        try
        {

        string szConn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +Path+ ";Extended Properties='Excel 8.0;HDR=YES;'";
        OleDbConnection conn = new OleDbConnection(szConn);
        conn.Open();
        OleDbCommand cmd = new OleDbCommand("INSERT INTO [Weather Report$]([Date],[Temperature]) VALUES('" + textBox1.Text + "','" + textBox3.Text + "')", conn);
        cmd.ExecuteNonQuery();


        conn.Close();

        }
        catch (Exception ex)
        {
        MessageBox.Show (ex.ToString());
        }
    }
</code></pre>
