用c#写的程序为什么出现下面的情况?求指点。
这是源代码:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace listbox
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
Data ds = new Data();
ds.Tables.Add("stu");
ds.Tables["stu"].Columns.Add("stuNo",typeof(int));
ds.Tables["stu"].Columns.Add("stuName",typeof (string));
ds.Tables["stu"].Columns.Add("stuScore",typeof(int));
ds.tables["stu"].Rows.Add(new object[] { 1, "张一", 100 });
ds.tables["stu"].Rows.Add(new object[] { 1, "王二", 100 });
ds.tables["stu"].Rows.Add(new object[] { 1, "李珊", 100 });
ds.tables["stu"].Rows.Add(new object[] { 1, "赵四", 100 });
ds.tables["stu"].Rows.Add(new object[] { 1, "周五", 100 });
ds.tables["stu"].Rows.Add(new object[] { 1, "钱六", 100 });
this.ListBox1.DataSource = ds.Tables["stu"];
this.ListBox1.DataValueField = "stuNo";
this.ListBox1.DataTextField = "stuName";
this.ListBox1.DataBind();
}
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Label1.Text = "你选择的学生是:学号"+this.ListBox1.SelectedValue.ToString()+"姓名"+this.ListBox1.SelectedItem.Text.ToString ();
}
}
}