主题:数据库问题
string co ="Data Source=HOME-6MVRBNW0UN;Initial catalog=成绩管理系统;Integrated Security=true;";
SqlConnection con =new SqlConnection (co);
con.Open ();
SqlCommand sc=new SqlCommand ();
sc.Connection =con;
sc.CommandText ="Insert into 成绩(学号,姓名,数学,语文)values(@ number, @name ,@shuxue ,@ yuwen )";
sc.CommandType =CommandType.Text ;
sc.ExecuteReader ();
请问这段代码有什么错吗?为什么运行会报错?
SqlConnection con =new SqlConnection (co);
con.Open ();
SqlCommand sc=new SqlCommand ();
sc.Connection =con;
sc.CommandText ="Insert into 成绩(学号,姓名,数学,语文)values(@ number, @name ,@shuxue ,@ yuwen )";
sc.CommandType =CommandType.Text ;
sc.ExecuteReader ();
请问这段代码有什么错吗?为什么运行会报错?