c# 以下代码段的功能是什么?
3.以下代码段的功能是什么?publicpartialclass_Default:System.Web.UI.Page{protectedvoidPage_Load(ob...
3. 以下代码段的功能是什么?
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("server=.;database=student;uid=sa;pwd=;");
conn.Open();
SqlCommand cmd = new SqlCommand("insert into tb_student(姓名,性别,出生日期,专业,年级,班级,身高,籍贯,电话) values('张庭','女','1997-4-23','信息','06','1班','166','沈阳',86840563)", conn);
cmd.ExecuteNonQuery();
Response.Write("添加成功!");
conn.Close();
}
} 展开
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("server=.;database=student;uid=sa;pwd=;");
conn.Open();
SqlCommand cmd = new SqlCommand("insert into tb_student(姓名,性别,出生日期,专业,年级,班级,身高,籍贯,电话) values('张庭','女','1997-4-23','信息','06','1班','166','沈阳',86840563)", conn);
cmd.ExecuteNonQuery();
Response.Write("添加成功!");
conn.Close();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询