This is a migrated thread and some comments may be shown as answers.

Database Connection failed after awhile

4 Answers 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
NeilNguyen
Top achievements
Rank 1
NeilNguyen asked on 21 Dec 2007, 04:26 PM
Hello Support Team,

I'm having 2 problems with Telerik Report version 2.0:

1/ I'm building a report libary,  I just create a report using a Stored Procedure with 2 parameters.

The problem is after a while or when I close the project and re-open it, when try to Preview the report, i got the error:
"Login failed for user 'myuser'"

But if I right click at SqlDataAdapter object, select Preview Data option, enter parameters i got return correct data.

Please tell me why the connect failed while I tried to Preview report?

2/ Let say 2 have 2 parameters: StartDate and EndDate.

I want to dynamic create a sub header for my report, like:

Period: StartDate - EndDate.

I would think using a Textbox with:
="Period " + Parameters.StartDate + " - " + Parameters.EndDate

But it doesnt recognize the Parameters.

How to achieve this goal?


thanks
Neil

4 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 27 Dec 2007, 02:47 PM
Hello NeilNguyen,
  1. About the problem with report preview:

    When you are creating a new SqlDataAdapter you have two ways to authenticate against the database server: the Windows authentication and the SQL Server authentication. If you are using Windows authentication there is no problem with report preview functionality, but if you are using SQL Server authentication you should select the Save my password check box as shown in the picture bellow:



    Later you should set default values for the parameters of the select statement. In the example on the picture bellow I am querying a stored procedure with one parameter and I have initialized its default value in the properties window:


     
     
  2. As for the compound expression, all is looking good, but we think that you may have mistaken report parameters (please see ReportParameters collection in Properties window) with SQL Query parameters in the CommandText and Parameters properties of SelectCommand property of SqlDataAdapter object. But you can set the value of an SqlAdapter parameters based on the respective Telerik Reporting parameters or vice versa depending on your needs. For more information on parameters, please take a look at the following article.

    If you have any other problems, please send us your project and data source and tell us what would you like to achieve. We would be glad if we can help.
Sincerely yours,
Ivan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
NeilNguyen
Top achievements
Rank 1
answered on 27 Dec 2007, 03:09 PM
Thanks Ivan, they all working fine now.

Best regards,

Neil Nguyen
 
0
Rossen Hristov
Telerik team
answered on 27 Dec 2007, 03:11 PM
Hello NeilNguyen,

We are glad that all is working fine now.

Greetings,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
NeilNguyen
Top achievements
Rank 1
answered on 27 Dec 2007, 03:16 PM
Hello Ross,

Happy New Year to Telerik Support team, you guys have been providing excellent Customer Support during the whole year, best wishes to everyone in your team.

Best regards,
Neil Nguyen
Tags
General Discussions
Asked by
NeilNguyen
Top achievements
Rank 1
Answers by
Ivan
Telerik team
NeilNguyen
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or