C#编程 学生信息添加。
帮我看一下这段代码,,红色部分是错误的using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySchoolDAL;
using MySchoolmodel;
namespace MySchool
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void BTAddStudent_Click(object sender, EventArgs e)
{
Student student = new Student();
student.StudentNo = Convert.ToInt32(this.txtStudentNo.Text.Trim());
student.LoginPwd = this.txtLoginPwd.Text.Trim();
student.StudentName = this.txtStudentName.Text.Trim();
string Grender = null;
if(this.RBF.Checked==true)
{
Gender=this.RBF.Text;
}
if(this.RBS.Checked==true)
{
Gender=this.RBS.Text;
}
student.Gender =Gender ;
student .GradeID=this.CBGradeID.SelectedItem.ToString ();
if(StudentServices1.AddStudent(student)>0)
{
MessageBox .Show("添加学生信息成功!");
}
else
{
return ;
}
}
}
}