日期:2014-05-18 浏览次数:21016 次
Info.CarStruct sd = new Info.CarStruct(); //sd.AddOil = true; DataTable data = new DataTable(); DataColumn dc1 = data.Columns.Add("一", typeof(String)); DataColumn dc2 = data.Columns.Add("个", typeof(String)); DataColumn dc3 = data.Columns.Add("例", typeof(String)); DataColumn dc4 = data.Columns.Add("子", typeof(String)); DataColumn dc5 = data.Columns.Add("而", typeof(String)); DataColumn dc6 = data.Columns.Add("已", typeof(String)); DataColumn dc7 = data.Columns.Add("。", typeof(String)); DataRow dr = data.NewRow(); dr[0] = sd.AddOil.ToString(); dr[1] = sd.CarSign.ToString(); dr[2] = sd.CarType.ToString(); dr[3] = sd.CarWangFan.ToString(); dr[4] = sd.Driver.ToString(); dr[5] = sd.OilAmount.ToString(); dr[6] = sd.OilName.ToString(); data.Rows.Add(dr); GridView1.DataSource = data; GridView1.DataBind();