mvaculisteanu mvaculisteanu - 1 year ago 107
C# Question

crystal reports asking for database password when i have not set any

Crystal reports is asking for database user and password when i try to view a report but i have not set any for my local *.sdf file.
My conection string only contains the dataset parameter and the passsword if i chose one but no user.

Answer Source

you can use this code :

ReportDocument1.DataSourceConnections.Item(0).SetConnection(strLocationOfDatabase, "", "UserName", "Password")

or if you dont have username and password :

ReportDocument1.DataSourceConnections.Item(0).SetConnection(strLocationOfDatabase, "", False)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download