Hi,
I have a small table with two columns: Id and name. But I need to reintialize my Id column anytime I need. I do write this code to see if its can works properly. But after running and click to my button. I receive an error message that say: error syntax in column definition
Anyone can Help please.
- private void button1_Click(object sender, EventArgs e)
- {
- OleDbCommand comm = new OleDbCommand("ALTER TABLE myTable ALTER " + " COLUMN Id AUTOINCREMENT(" + textBox1.Text + ",1)", conn);
- conn.Open();
- comm.ExecuteNonQuery();
- comm.Dispose();
- conn.Close();
- MessageBox.Show("Ok");
- }

Satish Kumar VadlavalliRank #1,134 · 1.6K reputationPosted Mar 27, 2018, 7:16 PM EDT
Manas TripathiRank #7,584 · 238 reputationPosted Mar 27, 2018, 5:52 PM EDT
IsraelRank #1,223 · 1.5K reputationPosted Mar 28, 2018, 7:03 AM EDT