You might need to pass some login credentials to your database.
myLogin.ConnectionInfo.Password = "";
myLogin.ConnectionInfo.UserID = "";
Your code currently passes empty strings.
On 9/28/07, amine akhavan < amine_akhavan%40yahoo.com">amine_akhavan
yahoo.com> wrote:
>
>
> Hello dear Friends
> I want to make a Report in Asp.Net
> I made a report that its name is RepMain and use below code.but I have
> login error.please help me.
> thanks
>
> try
> {
>
>
> SqlConnection crysCon=new SqlConnection(
> ConfigurationSettings.AppSettings["strCon"]);
> DataTable dtbl = new DataTable();
> string st="select * from Main";
> SqlDataAdapter MainDA=new SqlDataAdapter(st,strCon);
> MainDA.Fill(dtbl);
> DataSet MainDS=new DataSet();
> MainDS.Tables.Add();
>
> RepMain rpm= new RepMain();
> rpm.SetDataSource(MainDS);
> foreach(CrystalDecisions.CrystalReports.Engine.Table Main in
> rpm.Database.Tables)
> {
> myLogin = Main.LogOnInfo;
> myLogin.ConnectionInfo.Password = "";
> myLogin.ConnectionInfo.UserID = "";
> Main.ApplyLogOnInfo(myLogin);
> }
>
> RepMainViewer.DisplayGroupTree = false;
> RepMainViewer.ReportSource = rpm;
>
> }
> catch(Exception ex)
> {
> errorlbl.Text=ex.Message.ToString();
> Response.Write(ex.Message);
> }
>
>
>
>
>
>
> ---------------------------------
> Yahoo! oneSearch: Finally, mobile search that gives answers, not web
> links.
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
[Non-text portions of this message have been removed]
.