toopak
دوشنبه 28 مرداد 1387, 02:19 صبح
سلام
من تو کریستالم از دوتا جدول فیلد دارم
اما توی کد نویسی نمیدونم چیکارش کنم
Public Class frmacclist
Private Function fncGetData() As DataSet
Dim strconn As String = "provider=microsoft.jet.OLEDB.4.0;data source=" & Application.StartupPath & "\taxi.mdb;"
Dim sqlConnection1 As New OleDbConnection(strConn)
Dim strQuery As String = "Select * From tbaccounts"
Dim sqlDataAdapter1 As New OleDbDataAdapter(strQuery, sqlConnection1)
Dim dstData As New taxiDataSet
sqlDataAdapter1.Fill(dstData, "tbaccounts")
Return dstData
End Function
Private Sub frmacclist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strReportPath As String = GetCurrentDirectory()
If strReportPath.Substring(strReportPath.Length - 9) = "bin\Debug" Then
strReportPath = strReportPath.Substring(0, strReportPath.Length - 10)
End If
strReportPath &= "\rpacclist.rpt"
Dim rptEmployee As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
rptEmployee.Load(strReportPath)
Dim dstData As DataSet = fncGetData()
rptEmployee.SetDataSource(dstData)
CrystalReportViewer1.ReportSource = rptEmployee
End Sub
End Classالان فقط جدول tbaccounts وصله اما میخوام جدول setting رو هم وصل کنم
چارش چیه؟
من تو کریستالم از دوتا جدول فیلد دارم
اما توی کد نویسی نمیدونم چیکارش کنم
Public Class frmacclist
Private Function fncGetData() As DataSet
Dim strconn As String = "provider=microsoft.jet.OLEDB.4.0;data source=" & Application.StartupPath & "\taxi.mdb;"
Dim sqlConnection1 As New OleDbConnection(strConn)
Dim strQuery As String = "Select * From tbaccounts"
Dim sqlDataAdapter1 As New OleDbDataAdapter(strQuery, sqlConnection1)
Dim dstData As New taxiDataSet
sqlDataAdapter1.Fill(dstData, "tbaccounts")
Return dstData
End Function
Private Sub frmacclist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strReportPath As String = GetCurrentDirectory()
If strReportPath.Substring(strReportPath.Length - 9) = "bin\Debug" Then
strReportPath = strReportPath.Substring(0, strReportPath.Length - 10)
End If
strReportPath &= "\rpacclist.rpt"
Dim rptEmployee As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
rptEmployee.Load(strReportPath)
Dim dstData As DataSet = fncGetData()
rptEmployee.SetDataSource(dstData)
CrystalReportViewer1.ReportSource = rptEmployee
End Sub
End Classالان فقط جدول tbaccounts وصله اما میخوام جدول setting رو هم وصل کنم
چارش چیه؟