ToveBrolvenon
New Member
Hi I am working on the project vehicle tracking system i want to generate stoppage report it was working fine with php and extjs but now am changing the project to asp.net with C#.I have 4 different queries to display the report but in asp.net gridview how can i bind all the 4 different queries to display in gridview with pagination.Here is my PHP Code\[code\]$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)) \[/code\]