[求助]如何用数据命令向数据库插入数据
private void button1_Click(object sender, System.EventArgs e)
{
string string1=textBox1.Text;
string string2=textBox2.Text;
int num=System.Convert.ToInt32(textBox3.Text);
string mystring="integrated security=SSPI;data source=YY;persist security info=False;initial catalog=Sports;";
SqlConnection myconnection=new SqlConnection(mystring);
myconnection.Open();
string quarystring="INSERT INTO 项目表(ITEM,SEX,NUM) Values('string1','string2','num')";
SqlCommand mycommand=new SqlCommand(quarystring,myconnection);
myconnection.Close();
}
运行程序以后数据库里没有插入的数据记录,请问是怎么回事啊?