hi
i m using dataset for crystal report
1. insert database in app_data name serverdb
2. insert dataset in app_code name dsTest
3. insert crystal report and connect with dstest from database expert
4. wirte code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim crystalReport As New ReportDocument()
crystalReport.Load(Server.MapPath("~/crpt.rpt"))
Dim dsCustomers As dsTest = GetData("select * from tblTest")
crystalReport.SetDataSource(dsCustomers)
CrystalReportViewer1.ReportSource = crystalReport
End Sub
Private Function GetData(ByVal query As String) As dsTest
Dim cmd As New SqlCommand(query)
Using con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ServerDB.mdf;Integrated Security=True;User Instance=True")
Using sda As New SqlDataAdapter()
cmd.Connection = con
sda.SelectCommand = cmd
Using dsCustomers As New dsTest()
sda.Fill(dsCustomers, "tblTest")
Return dsCustomers
End Using
End Using
End Using
End Function
when i run in local it runs fine but when i run upload in domain server then error comes
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
please help