try
{
conn = new SqlConnection("Data Source=cpt-16;Initial Catalog=client;User ID=sa");
conn.Open();
if (conn.State.ToString ()== "Close")
{
conn.Open();
}
SqlCommand cmd = new SqlCommand("Insert into worker_info(workername,workersex,ptime,gtime)values('" + textBox1.Text + "' , '" + comboBox1.Text + "' , '" + textBox2.Text + "' , '" + textBox3.Text + "')", conn);
// cmd.CommandText = "Insert into worker_info(workername,workersex,ptime,gtime)values('" + textBox1.Text + "','" + comboBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "'))";
cmd.ExecuteNonQuery(); }
请高手帮忙看看有什么错误
{
conn = new SqlConnection("Data Source=cpt-16;Initial Catalog=client;User ID=sa");
conn.Open();
if (conn.State.ToString ()== "Close")
{
conn.Open();
}
SqlCommand cmd = new SqlCommand("Insert into worker_info(workername,workersex,ptime,gtime)values('" + textBox1.Text + "' , '" + comboBox1.Text + "' , '" + textBox2.Text + "' , '" + textBox3.Text + "')", conn);
// cmd.CommandText = "Insert into worker_info(workername,workersex,ptime,gtime)values('" + textBox1.Text + "','" + comboBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "'))";
cmd.ExecuteNonQuery(); }
请高手帮忙看看有什么错误
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货