0

hi i have following code in c# on button_click

ReportDocument cryRpt = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables ;

            cryRpt.Load(@"c:\users\shahaiali\documents\visual studio 2010\Projects\CrystalReportTesting\CrystalReport1.rpt");

            crConnectionInfo.ServerName = "ShaHaiAli-PC";
            crConnectionInfo.DatabaseName = "StudentInfo";
            crConnectionInfo.UserID = "user";
            crConnectionInfo.Password = "pass";

            CrTables = cryRpt.Database.Tables ;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();

as from the above code i already have provide the security info but when i execute the program it again ask me for the log-in..any help is there???

2
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by shahai.ali
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.