初学者--初级问题
小弟初学,只知道下面程序能跑,也不知道对不对
下面程序使数据录入数据库,但怎么多录入两条空信息,求教
SqlConnection MyConnection=new SqlConnection("server=local);database=scppc;uid=sa;password=123;");
MyConnection.Open();
string strSQL = "Insert Into 发布(作者, 主题, 内容,发表时间) Values ('"+UserName.Text+"','"+Title.Text+"', '"+ Content.Text+ "', '" +System.DateTime.Now +"')";
SqlCommand MyCommand=new SqlCommand(strSQL,MyConnection);
MyCommand.ExecuteNonQuery();
MyConnection.Close();