Databases Reference
In-Depth Information
if(!File.Exists(m.Groups[1].Captures [0].ToString ()))
{
throw (new ArgumentException(“Incorrect Filename”,”ConnectionString”));
}
this.m_fileName = m.Groups[1].Captures [0].ToString ();
}
VB.NET
Set(ByVal Value As String)
Me.m_connectionString = Value
Dim m As Match = Regex.Match(Value, “FileName=([^;]+)”,
RegexOptions.IgnoreCase)
If Not m.Success Then
Throw (New ArgumentException(“'FileName=<filename>' must be present string
and point to a valid DataSet xml file”, “ConnectionString”))
End If
If Not File.Exists(m.Groups(1).Captures(0).ToString) Then
Throw (New ArgumentException(“Incorrect FileName”, “ConnectionString”))
End If
Me.m_fileName = m.Groups(1).Captures(0).ToString
End Set
ConnectionTimeout Property
The ConnectionTimeout property allows you to set the timeout property of the connection. This is
used to control how long the interval for connecting to the source should be before an error is thrown.
Your class does not actually use this value, but it is implemented for consistency and due to interface
requirements. Returning a value of 0 indicates that there is an infinite timeout period.
C#
public int ConnectionTimeout
{
get
{ // Returns the connection time-out value.
// Zero indicates an indefinite time-out period.
return 0;
}
}
VB.NET
Public ReadOnly Property ConnectionTimeout() As Integer _
Implements IDbConnection.ConnectionTimeout
Get ' Returns the connection time-out value.
' Zero indicates an indefinite time-out period.
Return 0
End Get
End Property
Search WWH ::




Custom Search