コード例 #1
0
        public int  InsertStudentDetails(DaStudent dastd)
        {
          
            dastd.Result = GetResult();
            return dastd.InsertStudentDetails(dastd);

        }
コード例 #2
0
        public int InsertStudentDetails(DaStudent dastd)
        {
            int i = 0;
            SqlCommand cmd = new SqlCommand("sp_insertStudentDetails", con);
            cmd.Parameters.AddWithValue("@Name", dastd.Sname);
            cmd.Parameters.AddWithValue("@Subject1", dastd.Subject1);
            cmd.Parameters.AddWithValue("@Subject2", dastd.Subject2);
            cmd.Parameters.AddWithValue("@Subject3", dastd.Subject3);
           
            cmd.Parameters.AddWithValue("@Result",dastd.Result);
            con.Open();

            cmd.CommandType = CommandType.StoredProcedure;
           
                i = cmd.ExecuteNonQuery();
             con.Close();
            return i;

        }