Click here to Skip to main content
14,920,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem when crystal report running error
crystal report login failed "username","password"
Notes :
connection string don't have username and password like
cn = new SqlConnection(@"server=localhost; database=Issues; integrated security= true;");


C#
get_all_report myreport2 = new get_all_report();
                               
                myreport2.SetDatabaseLogon("sa", "", "localhost", "Issues", true);
                
                myreport2.SetParameterValue("@fld", "rep_number");
                myreport2.SetParameterValue("@val", textBox2.Text);
                report_view myform = new report_view();
                myform.crystalReportViewer1.ReportSource = myreport2;
                myform.ShowDialog();
Posted
Comments
aarif moh shaikh 23-Sep-15 8:39am
   
need not to authenticate in window authentication
Member 11538085 23-Sep-15 10:18am
   
i know but error message login failed

1 solution

If you connection string is not having credentials meaning it is accessing your windows authentication. So in your above code remove line having myreport2.SetDatabaseLogon or write your windows login id and password rather than "sa".
   
Comments
Member 11538085 23-Sep-15 10:20am
   
i don't understand you
i test like this
myreport2.SetDatabaseLogon("", "", "localhost", "Issues", true); the same error
Member 12003400 24-Sep-15 0:53am
   
Try removing this line. It will work.
OR
myreport2.SetDatabaseLogon("WindowsLoginID", "LoginPAssword", "localhost", "Issues", true);
Member 11538085 24-Sep-15 10:40am
   
thanks for you
i before remove the line it's work with me in local machine but when i setup the program in the customer appear this error crystal report login failed .
there i think should choose another salutation
if the customer don't have password in local machine and i want my program work without any password what can i do .
Member 12003400 25-Sep-15 1:02am
   
For that first create one sql user with password. In your connection string also include that userid and password. and then include this line myreport2.SetDatabaseLogon("sqlusername", "userpassword", "sqlservername", "Issues", true);

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