IConnectionInfo.UserID Property
Gets the user name for logging on to the data source.
Namespace CrystalDecisions.Shared Assembly CrystalDecisions.Shared (CrystalDecisions.Shared.dll)
Syntax
'Declaration
Public Overrideable MustInherit ReadOnly Property UserID As String
public virtual abstract string UserID {get;}
Example
This example shows how to set the logon information for IConnectionInfo.
'Declaration
Private Function VerifyLogOnInfo(ByVal myReportViewer As CrystalReportViewer) As Boolean
Dim result As Boolean = True
Dim i As Integer
For i = 1 To myReportViewer.LogOnInfo.Count
Dim myLogOnInfo As TableLogOnInfo = myReportViewer.LogOnInfo(i)
Dim myIConnectionInfo As IConnectionInfo = myLogOnInfo.ConnectionInfo
If (myIConnectionInfo.UserID.Length = 0 Or myIConnectionInfo.Password.Length = 0 _
Or myIConnectionInfo.ServerName.Length = 0 _
Or myIConnectionInfo.DatabaseName.Length = 0) Then
result = False
Exit For
End If
Next
VerifyLogOnInfo = result
End Function
private bool VerifyLogOnInfo(CrystalReportViewer reportViewer)
{
for (int i=0; i<reportViewer.LogOnInfo.Count; i++)
{
TableLogOnInfo logOnInfo = (TableLogOnInfo)reportViewer.LogOnInfo[i];
IConnectionInfo iConnectionInfo = (IConnectionInfo)logOnInfo.ConnectionInfo;
if (iConnectionInfo.UserID.Length == 0 || iConnectionInfo.Password.Length == 0 ||
iConnectionInfo.ServerName.Length == 0 || iConnectionInfo.DatabaseName.Length == 0)
{
return false;
}
}
return true;
}
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports .NET 10
See Also
Reference
IConnectionInfo Interface
IConnectionInfo Members
CrystalDecisions.Shared Namespace