Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello sirs and madammes, got a problem here. As you see my database is on my desktop and it isnt on my management express. My question is can i use pull method on this database. Ive tried adding it to my SSME but i think my program will not work cause im using datasets. If it (Pull Method) isnt possible can i change the connection of all my datasets?

thanks and more power sir!

Well sir ive tried using Push method but ive got an error saying
'CrystalReport3' is not defined
my dataset name is db1.xsd and the table is tblTrainingPlan
my .rpt is Crystalreport3
And lastly my codes are given via tutorials

VB
Public Sub BindReport()
    Dim myConnection As New SqlClient.SqlConnection()
    myConnection.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\TrainingPlanDatabase.mdf;Integrated Security=True;User Instance=True"
    Dim MyCommand As New SqlClient.SqlCommand()
    MyCommand.Connection = myConnection
    MyCommand.CommandText = "Select * from tblTrainingPlan"
    MyCommand.CommandType = CommandType.Text
    Dim MyDA As New SqlClient.SqlDataAdapter()
    MyDA.SelectCommand = MyCommand
    Dim myDS As New db1()
    MyDA.Fill(myDS, "tblTrainingPlan")
    Dim oRpt As New CrystalReport3()
    oRpt.SetDataSource(myDS)
    CrystalReportViewer1.ReportSource = oRpt
End Sub
Posted
Updated 9-Aug-11 18:02pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900