我在default.aspx.cs中有以下代码:
DataSet dsvehicle_info = new DataSet();
for (int i = 0; i < dsvehicle.Tables[0].Rows.Count; i++)
{
dsvehicle_info = cls.ReturnDataSet("RetriveData_Alias1",
new SqlParameter("@Field", "vehicle_no,lat,lon"),
new SqlParameter("@TblNm", "current_gps_data left join device_master on device_master.id=current_gps_data.id"),
new SqlParameter("@WhereClause", "where current_gps_data .id='" + dsvehicle.Tables[0].Rows[i]["id"].ToString() + "'"));
}
vehicle_info.DataSource = dsvehicle_info;
vehicle_info.DataBind();
当我运行它时,它将仅绑定 last 记录。 如何绑定所有数据?
答案 0 :(得分:0)
有什么理由你不能这样添加吗?
DataSet dsvehicle_info= new DataSet("VehicleInfo");
dsvehicle_info.Tables.Add(dsvehicle.Tables[0]);