'Declaration expected' error

kkirtac

Member
Joined
Apr 25, 2006
Messages
13
hi, here is my code, i receive strange error...
Code:
Dim rptKadirReport As ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim reportPath As String = Application.StartupPath & "\.." & "\.." & "\" & "KadirReport.rpt"

Private connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=dental.mdb"
Private conn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(connStr)
conn.Open()

Dim str As String = "SELECT AD, SOYAD, CEP_TEL FROM HASTA"
Dim da1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(str, conn)
Dim ds1 As DataSet = New DataSet("Hasta")
da1.Fill(ds1, "HASTA")

Dim ds2 As DataSet = New DataSet("Tarih")
str = "SELECT TARIH FROM MUAYENE"
Dim da2 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(str, conn)
da2.Fill(ds2, "MUAYENE")

Dim ds3 As DataSet = New DataSet("Islem_Adi")
str = "SELECT ISLEM_ADI FROM ISLEMLER"
Dim da3 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(str, conn)
da3.Fill(ds3, "ISLEMLER")

ds1.Merge(ds2)
ds1.Merge(ds3)
conn.Close()

rptKadirReport.Load(reportPath)
rptKadirReport.SetDataSource(ds1)
crvKadir.ReportSource = rptKadirReport

here i receive the same Declaration expected for these : conn, da1, da2, str, da3, rptKadirReport, crvKadir
strange isnt it...
 
Last edited by a moderator:
Maybe it has something to do with the fact that you dim the same variables more than once.
 
Oops. My bad. I guess I cant read. I couldnt tell the das from the dss.
 
Is this all one method or have you pasted several bits of code together? Just curious because the Private keyword isnt valid inside a method body.
 


Write your reply...
Back
Top