SqLite save to DataBase
Booney
166
Reputation points
I am trying to save 5 textboxs 1 combo and datetimepicker to a database but the only thing saved is the datetimepicker. I am very confused with this and dont see why this code isn't working any suggestions much appreciated.
private void btn_Save_Click(object sender, EventArgs e)
{
if (lbl_LibId.Text == "*")
{
string sql = "insert into Request (Date, Part_Number, Request_By, Assigned_CC, IC_Analyst, Priority, Comments)" +
" values(@Date, @Part_Number, @Request_By, @Assigned_CC, @IC_Analyst, @Priority, @Comments)";
Request.ExecuteSQL(sql, new[] {
new SQLiteParameter("@Date", dateTimePicker1.Text),
new SQLiteParameter("@Part_Number", txt_Part_Number.Text),
new SQLiteParameter("@Request_By", txt_Count_Request_By.Text),
new SQLiteParameter("@Assigned_CC", txt_Assigned_Code.Text),
new SQLiteParameter("@IC_Analyst", txt_Analyst.Text),
new SQLiteParameter("@Priority", cb_Priority.Text),
new SQLiteParameter("@Comments", txt_Comments.Text),
});
DataBind();
}
}
Sign in to answer