Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows C#4.0 Desktop
Hello friends,
I am developing an desktop application in which i have created crystal report which uses SQL-Server express 2008 (which comes built-in with VS2010). It asks for Username and password which I don't know. What should I do?
 
I have searched on Google and here too, but nothing of my use.
 

 
Thanks in advance.
Posted 29-Mar-13 22:43pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you can initialize the login authentication by using the
SetDatabaseLogon
 

 
here's reference link:
http://msdn.microsoft.com/en-us/library/ms226061(v=vs.80).aspx[^]
 
its something like this:
 
dim rpt as new rptCrystalReportFileName
 
rpt.SetDatabaseLogon(username,password)
 
hope that helps...
  Permalink  
Comments
javedsmart at 30-Mar-13 6:20am
   
I know the procedure but what's the password for sqlexpress 2008? while installing it didn't ask for password.
deo cabral at 3-Apr-13 22:59pm
   
just open your mssql server management studio and login as windows authentication and try to activate the sa default account
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Crystal Report is different application, Your database(sql express) is different application. Crystal report depends on SqlServer for data. When it need data then it goes to sqlserver. Then sqlserver ask authentication that you currently face. Now i hope you understand crystal report actually ask sqlserver authentication information by which it request to sqlserver for data and after getting that data it will show that on its report withing report viewer component. The following code can help you which will demonastrate how crystal report configure sqlserver authentication information for a particular report:
void Form_Load(object sender, EventArgs e)
{
       ConnectionInfo myConnectionInfo = new ConnectionInfo();
 
        myConnectionInfo.ServerName = "serverName";
        myConnectionInfo.DatabaseName = "DatabaseName";
        myConnectionInfo.UserID = "sa";
        myConnectionInfo.Password = "pwd";
        setDBLOGONforREPORT(myConnectionInfo);
}
void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
{
        TableLogOnInfos mytableloginfos = new TableLogOnInfos();
        mytableloginfos = CrystalReportViewer1.LogOnInfo;
        foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
        {
            myTableLogOnInfo.ConnectionInfo = myconnectioninfo;
        }
 }
  Permalink  
Comments
javedsmart at 30-Mar-13 6:23am
   
Thanks. I know the procedure. As i mentioned in my question i dont know username and password. it is express version of SQL which gets installed with VS2010.
S. M. Ahasan Habib at 30-Mar-13 8:58am
   
If it is sqlserver expressed then you just first login it with management studio with windows authentication then you can active sa (system administrator) user and set its password or you can create another user(login,user) then set it to crystal report

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Dnyaneshwar@Pune 604
1 thatraja 380
2 OriginalGriff 236
3 Gihan Liyanage 210
4 kbrandwijk 204
0 OriginalGriff 737
1 Dnyaneshwar@Pune 604
2 Kornfeld Eliyahu Peter 505
3 Sergey Alexandrovich Kryukov 405
4 thatraja 370


Advertise | Privacy | Mobile
Web04 | 2.8.140902.1 | Last Updated 30 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100