Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: logon problem Post Reply Post New Topic
Author Message
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Topic: logon problem
    Posted: 07 Jan 2011 at 6:47am
i have a problem i use vs 2008 and sql server 2005 when i deploy the app i use sql server express and i get an error of database login problem how can i solve it and what i must write in server name

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Jan 2011 at 7:31am
Is this asp.NET program or Winforms?  Are you using the CrystalViewer object model or the ReportDocument object model?  Please post the code that you're using to call the report and view it.
 
-Dell
IP IP Logged
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Posted: 07 Jan 2011 at 7:37am
here is the code
CrystalReport8 cr3 = new CrystalReport8();
            CrystalDecisions.Shared.ParameterFields paramFields = new CrystalDecisions.Shared.ParameterFields();
            CrystalDecisions.Shared.ParameterField paramField = new CrystalDecisions.Shared.ParameterField();
            CrystalDecisions.Shared.ParameterDiscreteValue paramValue1 = new CrystalDecisions.Shared.ParameterDiscreteValue();
            //int number = Int32.Parse(textBox1.Text);

            TableLogOnInfo myLogin;

            foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in cr3.Database.Tables)
            {
                myLogin = myTable.LogOnInfo;

myLogin.ConnectionInfo.ServerName= "i don't know what i must write here "
                myLogin.ConnectionInfo.IntegratedSecurity = true;
                myLogin.ConnectionInfo.DatabaseName = "ComputerStock";
                myTable.ApplyLogOnInfo(myLogin);

            }
           
          
           

            paramField.ParameterFieldName = "@salid";
            //Setting the first discrete value and passing it to the parameter
            paramValue1.Value = Int32.Parse(textBox1.Text);
            paramField.CurrentValues.Add(paramValue1);
            //Add the parameter fields to the parameter fields collection
            paramFields.Add(paramField);

            //The second parameter date
            //paramField = new CrystalDecisions.Shared.ParameterField();
            //paramField.ParameterFieldName = "@ToDate";
            //Setting the first discrete value and passing it to the parameter

            //Add the parameter fields to the parameter fields collection
            paramFields.Add(paramField);
          
            Reports.salerep sr = new salerep();
            sr.crystalReportViewer1.ParameterFieldInfo = paramFields;
            //sr.crystalReportViewer1.SelectionFormula= "{OutOrders.OutOrderId} = "+Int32.Parse(textBox1.Text)+"";

            sr.crystalReportViewer1.ReportSource = cr3;
            sr.crystalReportViewer1.Refresh();
            sr.Show();

thanks for your care
IP IP Logged
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Posted: 07 Jan 2011 at 7:41am
it's windows forms app
IP IP Logged
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Posted: 07 Jan 2011 at 7:49am
i wait for ur solution thanks man
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Jan 2011 at 9:00am
ServerName should be the name of the SQL Server Express instance - I believe this is usually the name of the computer where it's installed.  If I correctly understood your original post, this will probably be in different places for each install of your software.  I assume you have a way of setting up the connection string for your application to read/write to the database, so you'll have to use something similar to get the server name (which you need for your connection string) for your reports.
 
-Dell
IP IP Logged
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Posted: 08 Jan 2011 at 4:44am

i still get the error when i still on sql server 2005 the reports run fine

but when i run the reports on another machine that have sql express it show the login database
please answer me  
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Jan 2011 at 4:04am

Since there is no 'native' connection to SQL Server in Crystal, are you using an ODBC connection or an OleDB connection?  If you're using the ODBC connection, is an ODBC System DSN set up on the computer where you're installing the software that matches the one you designed the report with?  At that point, the server name should be the name of the ODBC connection.

If you're using an OleDB connection you need to make sure the oledb client is installed on the workstation and ServerName will be the name of the SQL Server instance.
 
-Dell
IP IP Logged
fanan
Newbie
Newbie
Avatar

Joined: 02 Jan 2011
Location: Egypt
Online Status: Offline
Posts: 28
Quote fanan Replybullet Posted: 11 Jan 2011 at 10:55am
where i find oledb cloent to install 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Jan 2011 at 5:33am
It should be available from Microsoft as part of the SQL Server client install - it's an optional feature that is not installed by default.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.017 seconds.