Hi , i am getting syntax error in INSERT INTO statement. getting this error on cmdobj.ExecuteNonQuery();

string connectionstring = @"Provider=Microsoft.ACE.OLEDB.12.0;
        Data Source=D:\website\AddContact.xlsx; Extended Properties=""Excel 8.0;HDR=Yes"";";
        OleDbConnection conobj = new OleDbConnection(connectionstring);
        string Query = "INSERT INTO [Sheet1$](Fname, LName,PhoneNo,Email-ID) values (" + TextBox4.Text + ",'" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "')";
        OleDbCommand cmdobj = new OleDbCommand(Query, conobj);
        conobj.Open();
        cmdobj.ExecuteNonQuery();
        conobj.Close();

Stack Trace:


[OleDbException (0x80040e14): Syntax error in INSERT INTO statement.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108
Addcontact.Button1_Click(Object sender, EventArgs e) in d:\WebSite\Addcontact.aspx.cs:67
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5087

try this ..I hope it will work ,,change feils acording to your requirment.
Thanx Shakeb khan

"INSERT INTO [Task$] ([CLIENTS], [ASSIGNMENTS], [STATUS], [ELAPSED TIME]) VALUES( '" + cbClient.Text + "', '" + cbAssignment.Text + "', 'IDLE', '0')

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.