private void btnShow_Click(object sender, EventArgs e) { Studnet[] std = new Studnet[2]; std[0].id = "A102001"; std[0].name = "許清榮"; std[0].score = 100; std[0].avg = null; std[1].id = "A102002"; std[1].name = "吳宜隆"; std[1].score = null; std[1].avg = 90; string msg = ""; foreach (var v in std) { msg = msg + "學號:" + v.id + "\n"; msg = msg + "姓名:" + v.name + "\n"; msg = msg + "分數:" + v.score + "\n"; msg = msg + "平均:" + v.avg + "\n"; } MessageBox.Show(msg, "Nullable類別範例"); }
public DataTable GetList_S(Studnet s) { DB.IDB dd = new DB.DBByHandClose(AppSetting.con); return(dd.ExecuteToTable($"select * from Student ")); }
public int AddStudent(Studnet model) { return(dal.AddStudent(model)); }
public int AddStudent(Studnet model) { int row = dbconn.Execute("insert into Student values(@StudentName,@StudentSex,@StudentAge,@BId)", model); return(row); }
public int AddStudent(Studnet model) { int row = bll.AddStudent(model); return(row); }
public int Add(Studnet obj) { return(bll.AddStudent(obj)); }