Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automate Logon
Message
General information
Forum:
ASP.NET
Category:
Reporting
Title:
Miscellaneous
Thread ID:
00780453
Message ID:
00780481
Views:
13
Hi Rick,

Yes, you can automate the logging by creating a ConnectionInfo class and applying it to each table. Here is an example:
Dim crReportDocument As New CustReport()
Dim crTableLogOnInfo As New TableLogOnInfo()
Dim crConnectionInfo As New ConnectionInfo()
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim crtable As CrystalDecisions.CrystalReports.Engine.Table


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  crConnectionInfo.ServerName = "MyServer"
  crConnectionInfo.DatabaseName = "MyDatabase"
  crConnectionInfo.UserID = "sa"
  crConnectionInfo.Password = ""

  crDatabase = crReportDocument.Database
  crTables = crDatabase.tables

  For Each crtable In crTables
    crTableLogOnInfo = crtable.LogOnInfo
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    crtable.ApplyLogOnInfo(crTableLogOnInfo)
  Next

  Me.crvReport.ReportSource = crReportDocument
>Is there a way to automate logging on to a SQL server.
>
>My windows app launches a report, and the SQL database logon screen always appears. Can this information be passed programatically? I don't want end-users to have to interact with the logon screen.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform