嗨,我正在研究项目车辆跟踪系统,我想生成停机报告,它可以在 php 和 extjs 中正常工作,但现在正在使用 C# 将项目更改为 asp.net。我有 4 个不同的查询来显示报告,但在 asp 中。 net gridview 如何绑定所有 4 个不同的查询以在带有分页的 gridview 中显示。
这是我的 PHP 代码
$NewID = "";
$OldID = "";
//echo("Select gps_id,lat,lon,tdate,ttime,tdate_time,speed,lname from gps_data where vehicle_no = '$vno' and (CONVERT(tdate_time, DATETIME) between '$FromDate' and '$ToDate') and speed > 1 order by gps_id asc");
$sql1 = mysql_query("Select gps_id,latitude,longtitude,get_date,get_time,get_date_time,speed,location from gps_data where device_id = '$device_id' and host_name = '". $host ."' and (CONVERT(get_date_time, DATETIME) between '$FromDate' and '$ToDate') and speed > 1 order by gps_id asc");
while($row = mysql_fetch_row($sql1))
{
$NewID = $row[0];
//echo($OldID);
if($OldID > 0)
{
// echo("Select CONVERT(tdate_time, DATETIME) from gps_data where gps_id = ". $OldID ."");
$query = mysql_query("Select get_date_time,date_time from gps_data where gps_id = ". $OldID ." and host_name = '". $host ."'");
if($result = mysql_fetch_row($query))
{
$show_old_get_date_time = $result[0];
$old_get_date_time = $result[1];
//echo($old_get_date_time);
}
$query1 = mysql_query("Select get_date_time,date_time from gps_data where gps_id = ". $NewID ." and host_name = '". $host ."'");
if($result1 = mysql_fetch_row($query1))
{
$show_new_get_date_time = $result1[0];
$new_get_date_time = $result1[1];
}
//echo("Select gps_id,lat,lon,tdate,ttime,tdate_time,speed,lname from gps_data where vehicle_no = '$vno' and gps_id > ". $OldID ." and gps_id < ". $NewID ." and (CONVERT(tdate_time, DATETIME) between '$FromDate' and '$ToDate') order by gps_id asc");
$sql2 = mysql_query("Select gps_id,latitude,longtitude,get_date,get_time,get_date_time,speed,location from gps_data where device_id = '$device_id' and host_name = '". $host ."' and gps_id > ". $OldID ." and gps_id < ". $NewID ." and (CONVERT(get_date_time, DATETIME) between '$FromDate' and '$ToDate') order by gps_id asc");
if($rowA = mysql_fetch_row($sql2))
{
$NewLoc = parseD($rowA[7]);
//echo("SELECT TIMEDIFF('". $new_get_date_time ."','". $old_get_date_time ."')");
$sql3 = mysql_query("SELECT TIMEDIFF('". $new_get_date_time ."','". $old_get_date_time ."')");
if($rowB = mysql_fetch_row($sql3))
{
$cnt = $cnt + 1;
$DTDiff = $rowB[0];
$strBld .= $comm."{slno:\"". $cnt ."\",get_date:\"". $rowA[3] ."\",get_date_time:\"". $show_old_get_date_time." "."-"." ". $show_new_get_date_time ."\",stoppedTm:\"". $DTDiff ."\",loc_name:\"". $NewLoc ."\",latitude:\"".$rowA[1]."\",longitude:\"".$rowA[2]."\"}";
$comm = ",";
}
} //while($rowA = mysql_fetch_row($sql2))
} //if($OldID > 0)
$OldID = $row[0];
//echo($OldID);
} //while($row = mysql_fetch_row($sql1))