p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   .NET Web Services (http://p2p.wrox.com/forumdisplay.php?f=102)
-   -   Windows Authentication prob pl help (http://p2p.wrox.com/showthread.php?t=11839)

msrnivas April 14th, 2004 09:56 PM

Windows Authentication prob pl help
 
Hi
I am working on crystall reports in ASP.net.When try to connect my local sqlserver using sa account my report is working fine.
When i try connect anothe sql server (which is reside on some other machine) using window authentication i am getting invalid table number error.When i debug my code its giving error at CrTable.Location line.here i am giving my code pl pl help me.

thanks

Dim rptAttendance As New ReportDocument
Dim strDBServer As String
Dim strDBName As String
Dim strUserName As String
Dim strPassword As String
Dim strReportFilePath As String
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
Dim TableCounter

Dim crReportDocument As New ReportDocument
strReportFilePath = Request.MapPath("").ToString
strReportFilePath = strReportFilePath & "\" & "test2.rpt"
crReportDocument.Load(strReportFilePath)

strDBServer = "Acc"
strDBName = "Sales"

With crConnectionInfo
.ServerName = strDBServer
.DatabaseName = strDBName
End With

CrTables = crReportDocument.Database.Tables

'Loop through each table in the report and apply the
'LogonInfo information

For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
CrTable.Location = strDBName & ".dbo." & CrTable.Location.Substring (CrTable.Location.LastIndexOf(".") + 1)
Next
CrystalReportViewer1.DisplayToolbar = True
CrystalReportViewer1.DisplayPage = True
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ReportSource = crReportDocument




All times are GMT -4. The time now is 12:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.