存储过程使用出错(急)
下面的代码,怎么没有把我数据插入到数据库(其中Insert_teacher是在数据库里写好的insert into插入存储过程)
................................................
................................................
..........
string str = ConfigurationManager.ConnectionStrings["CourseConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(str);
conn.Open();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("select * from teacher", conn);
da.Fill(ds, "teacher");
da.InsertCommand = new SqlCommand("Insert_teacher", conn);
da.InsertCommand.CommandType = CommandType.StoredProcedure;
da.InsertCommand.Parameters.Add(new SqlParameter("@tid", SqlDbType.Char, 10));
da.InsertCommand.Parameters["@tid"].Value = teacherNumber.Text.Trim();
da.InsertCommand.Parameters.Add(new SqlParameter("@tname", SqlDbType.VarChar, 50));
da.InsertCommand.Parameters["@tname"].Value = teacherName.Text.Trim();
da.InsertCommand.Parameters.Add(new SqlParameter("@tpwd", SqlDbType.VarChar, 50));
da.InsertCommand.Parameters["@tpwd"].Value = teacherPwd.Text.Trim();
da.InsertCommand.Parameters.Add(new SqlParameter("@tpost", SqlDbType.Char, 10));
da.InsertCommand.Parameters["@tpost"].Value = teacherPost.Text.Trim();
da.Update(ds, "teacher");
conn.Close();
Response.Redirect("ManageList.aspx");
................
...............