i have developed a code for insert data to sql compact server?
string connetionString = null;
connetionString = "Data Source=stockDb.sdf";
using (SqlCeConnection con = new SqlCeConnection(connetionString))
{
con.Open();
string sqlquery = ("insert into Enquiry(userName,cusName,cusContact,subDate,reqDate,moreDetails,tktType,noPax,firstStatus,secStatus,thirdStatus)Values(@uName,@cName,@cContact,@sDate,@rDate,@mDetails,@tType,@nPax,@fStatus,@sStatus,@tStatus)");
SqlCeCommand command = new SqlCeCommand(sqlquery, con);
string submitDate = sDate.Value.ToString("yyyy-MM-dd");
string requireDate = mDate.Value.ToString("yyyy-MM-dd");
int value = Convert.ToInt32(Cus_PaxNo.Text);
command.Parameters.AddWithValue("@uName", Loginlbl.Text);
command.Parameters.AddWithValue("@cName", Cus_Name.Text);
command.Parameters.AddWithValue("@cContact", Cus_Contact.Text);
command.Parameters.AddWithValue("@sDate", submitDate);
command.Parameters.AddWithValue("@rDate", requireDate);
command.Parameters.AddWithValue("@mDetails", Cus_Details.Text);
command.Parameters.AddWithValue("@tType", Cus_TicketType.Text);
command.Parameters.AddWithValue("@nPax", value);
command.Parameters.AddWithValue("@fStatus", Cus_FirstStatus.Text);
command.Parameters.AddWithValue("@sStatus", Cus_SecondStatus.Text);
command.Parameters.AddWithValue("@tStatus", Cus_ThirdStatus.Text);
command.ExecuteNonQuery();
MessageBox.Show("Password Accepted");
}
this code gave me an error saying?
An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException'occured in System.Data.SqlserverCe.Dll