回答済み Data table not filled

  • 2012年4月30日 9:06
     
     

     If Page.IsPostBack = False Then
                Dim strAccidentQuery As String = ""
                Dim strScheduleMaintenance As String = ""
                Dim strBreak As String = ""

                strBreak = " Select * from CarTrnRental A " & _
                           "inner join Car_TrnBreakDownMaint E on E.TrnID=A.TrnID " & _
                           "inner join CarMstMake B on A.MakeID=B.MakeID " & _
                           "inner join CarMstRental D on D.TrnID=A.TrnID " & _
                           "inner join CarMstLocation L on L.LocationID=A.LocationID "


                strAccidentQuery = " Select * from CarTrnRental A " & _
                                   "inner join Car_TrnAccidentMaintenance E on E.TrnID=A.TrnID " & _
                                   "inner join CarMstMake B on A.MakeID=B.MakeID " & _
                                   "inner join CarMstRental D on D.TrnID=A.TrnID " & _
                                   "inner join CarMstLocation L on L.LocationID=A.LocationID"

                'strQry2 = " Select * from CarTrnRental A " & _                                            Dont uncomment
                '           "inner join Car_TrnAccidentMaintenance E on E.TrnID=A.TrnID " & _
                '           "inner join CarMstMake B on A.MakeID=B.MakeID " & _
                '           "inner join CarMstRental D on D.TrnID=A.TrnID " & _
                '           "inner join CarMstLocation L on L.LocationID=A.LocationID"

                strScheduleMaintenance = " Select * from CarTrnRental A " & _
                          "inner join Car_TrnScheduleMaintenance E on E.TrnID=A.TrnID " & _
                         "inner join CarMstMake B on A.MakeID=B.MakeID " & _
                         "inner join CarMstRental D on D.TrnID=A.TrnID " & _
                         "inner join CarMstLocation L on L.LocationID=A.LocationID  " & _
                       "inner join Car_MstScheduleMaintJobSheet T on T.TrnId=A.TrnID"

                Dim sqladptAccient As New SqlDataAdapter(strAccidentQuery, CommConn)
                Dim sqladptSchedule As New SqlDataAdapter(strScheduleMaintenance, CommConn)
                Dim sqladptBreak As New SqlDataAdapter(strBreak, CommConn)

                Dim dtAccident As New DataTable
                Dim dtSchedule As New DataTable
                Dim dtBreakdown As New DataTable
                CommConn.Open()
                sqladptAccient.Fill(dtAccident)
                sqladptBreak.Fill(dtBreakdown)
                sqladptSchedule.Fill(dtSchedule)

     rgView2.DataSource = dtAccident
                rgView2.DataBind()
                rgView1.DataSource = dtBreakdown
                rgView1.DataBind()
                rgView3.DataSource = dtSchedule
                rgView3.DataBind()
                CommConn.Close()

                rgView2.Visible = True
                'rgView2.Rebind()
                rgView1.Visible = True
                'rgView1.Rebind()
                rgView3.Visible = True
                'rgView3.Rebind()
                radtab1.Visible = True


すべての返信