テーブル名で満たされたコンボボックスを使用しています。挿入コマンドを作成し、コンボボックスの値を取得してテーブル名を決定すると、機能しませんでした
private void Form2_Load(object sender, EventArgs e)
{
Conn.Open();
foreach (DataRow dr in dt.Rows)
{
comboBox1.Items.Add(dr["TABLE_NAME"].ToString());
}
Conn.Close();
}
//cmd = new SqlCommand("insert into dbo."+ comboBox1.SelectedItems.ToString() +"(Phone, Email, Address) values('" + txt1.Text + "','" + txt2.Text + "','" + txt3.Text + "')", Conn);