asking for database login in crystal reports

i am using crystal reports 11. as soon as when i call .Show() method in vb.net
its asking for database logon,
i tried this cReport.SetDatabaseLogon("pos", "pos", g_strServerName, g_strDbName, False)
still its asking for it
wt to do?
x1877Asked:
Who is Participating?
 
x1877Author Commented:
got the solution, i had to add the following code after loading the report.


            cReport.Load(Application.StartupPath & strReportFilName)


These  lines ->

            Dim objTableLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo
            Dim objConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            objConnectionInfo.ServerName = g_strServerName
            objConnectionInfo.DatabaseName = g_strDbName
            objConnectionInfo.UserID = g_strUserName
            objConnectionInfo.Password = g_strPwd
            objTableLogOnInfo.ConnectionInfo = objConnectionInfo
            cReport.Database.Tables(0).ApplyLogOnInfo(objTableLogOnInfo)

Thanks

Pl. refund the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.