I'm using C# and Microsoft Microsoft® SQL Server® Compact
All data inserts like this in the database
Ex I input my name database store like this
System.Windows.Forms.TextBox, Text: chamikara
There any way to remove this part "
System. Windows. Forms. TextBox, Text: "
your help is greatly appreciated
My Code
SqlCeConnection con = new SqlCeConnection("Data Source=" + app_path + "\\application.sdf;Persist Security Info=False;");
con.Open();
SqlCeCommand cm = new SqlCeCommand("INSERT INTO tbl_user(u_id,u_name,u_scl,u_que) VALUES (@u_id,@u_name, @u_scl, @u_que)", con);
cm.Parameters.AddWithValue("@u_id", 1);
cm.Parameters.AddWithValue("@u_name", txtpass.ToString());
cm.Parameters.AddWithValue("@u_scl", txtans.ToString());
cm.Parameters.AddWithValue("@u_que", index);
try
{
int eff = cm.ExecuteNonQuery();
if (eff == 1)
{
con.Close();
MessageBox.Show("Data Added " , "Done");
}
else
{
con.Close();
MessageBox.Show("not inserted ", "Error");
}
}
catch (SqlCeException ex)
{
MessageBox.Show(ex.ToString());
}