朋友们帮帮偶了,伤人

pig_niuniu pig_niuniu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问这代码怎么滴?下面错误看不懂

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
...全文
评论 15
收藏 已收藏
分享
返回顶部
pig_niuniu
C# 111,128 成员 642,537 内容