here is my code
private void button1_Click(object sender, EventArgs e)
{
try
{
string connectionString = @"Data Source=|DataDirectory|\Database_POS.sdf";
using (SqlConnection connection = new SqlConnection(connectionString))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText= "INSERT INTO Customer (Email) Values (@email);";
command.Parameters.AddWithValue("@email",textBox_Email.Text);
connection.Open();
command.ExecuteNonQuery();
}
}
catch (SqlException ex)
{
Console.WriteLine(ex.Message);
}
}
here is my design

I am only trying to save 'email' here.
Here is my sql table, problem is I can not even save a single field into table .

Database Design

Now error is this

connectionStringcorrect , have you trace using break point ?Idfield doesn't look like a primary key because it is nullable. Without a primary key how are you going to identify your records?