Question crystal report from database incorrect syntax

swemohamed

New member
Joined
Feb 4, 2015
Messages
2
Programming Experience
Beginner
what error in this code
error message is : Incorrect syntax near '.'.
Untitled.png

HTML:
 Private Sub repgroup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim cn As New SqlConnection
        If cn.State = ConnectionState.Open Then cn.Close()
        cn.ConnectionString = "Data Source=mohamed-swe\sqlexpress;Initial Catalog=project;Integrated Security=True"
        cn.Open()

        Dim ds As New DataSet33
        Dim sql As String = " SELECT  dbo.pers_info.expert_name, dbo.pers_info.expert_bday, dbo.pers_info.expert_gender, dbo.pers_info.expert_mstatus, " &
        "dbo.pers_info.expert_address, dbo.pers_info.expert_origin, dbo.pers_info.expert_tel, dbo.pers_info.expert_nno, dbo.pers_info.expert_hstatus," &
        "dbo.pers_info.expert_disease, dbo.pers_info.expert_email, dbo.acad_qualific_info.Aqualific_info_name, dbo.acad_qualific.aqualific_name," &
       " dbo.researches_and_papers.Res_pap_tittle, dbo.researches_and_papers.Res_pap_type, dbo.researches_and_papers.Res_pap_date," &
      "  dbo.Experience.Work_place_name, dbo.Experience.Work_place_type, dbo.Experience.Date_of_start_work, dbo.Experience.Date_of_end_work," &
      "  dbo.Experience.Employer_level, dbo.Achievements.Achievement_name, dbo.Achievements.Achievement_date, dbo.Achievements.Achievement_notice" &
"FROM         dbo.pers_info INNER JOIN" &
                   "   dbo.acad_qualific_info ON dbo.pers_info.expert_no = dbo.acad_qualific_info.Expert_no INNER JOIN" &
                    "  dbo.acad_qualific ON dbo.acad_qualific_info.Aqualific_no = dbo.acad_qualific.aqualific_no INNER JOIN" &
                 "     dbo.researches_and_papers ON dbo.pers_info.expert_no = dbo.researches_and_papers.Expert_no INNER JOIN" &
                     " dbo.Experience ON dbo.pers_info.expert_no = dbo.Experience.Expert_no INNER JOIN" &
                     " dbo.Achievements ON dbo.pers_info.expert_no = dbo.Achievements.Expert_no" &
"ORDER BY dbo.pers_info.expert_name"

        Dim da As New SqlDataAdapter(sql, cn)

        da.Fill(ds)
        Dim rt As New CrystalReport12
        rt.SetDataSource(ds)
        CrystalReportViewer1.ReportSource = rt
    End Sub
 
Last edited:
Back
Top