朋友们帮帮偶了,伤人
请问这代码怎么滴?下面错误看不懂
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Chp4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Load();
}
private void Load()
{
string contxt = "server=.;database=MySchool;uid=sa;pwd=";
SqlConnection con = new SqlConnection(contxt);
con.Open();
string sql = "select StudentNo,StudentName,Gender,g.GradeName from Student s inner join Grade g on g.GradeId= s.GradeId";
SqlCommand com = new SqlCommand(sql, con);
SqlDataReader read = com.ExecuteReader();
while (read.Read())
{
string stuNo = read["StudentNo"].ToString();
string stuName = read["StudentName"].ToString();
string stuGender = read["Gndeer"].ToString();
string stuGrade = read["GradeName"].ToString();
ListViewItem item = new ListViewItem(stuNo);
item.SubItems.Add(stuName);
item.SubItems.Add(stuGender);
item.SubItems.Add(stuGrade);
listView1.Items.Add(item);
}
read.Close();
}
}
}
警告 1 “Chp4.Form1.Load()”隐藏了继承的成员“System.Windows.Forms.Form.Load”。如果是有意隐藏,请使用关键字 new。 F:\寒假\Chp4\Chp4\Form1.cs 25 22 Chp4
错误 2 “Load”是一个“方法组”,无法为它赋值 F:\寒假\Chp4\Chp4\Form1.Designer.cs 118 13 Chp4