@@ -105,6 +105,11 @@ internal static ObjectDisposedException ObjectDisposed(object instance)
105105 return e ;
106106 }
107107
108+ internal static Exception DataTableDoesNotExist ( string collectionName )
109+ {
110+ return Argument ( SR . GetString ( SR . MDF_DataTableDoesNotExist , collectionName ) ) ;
111+ }
112+
108113 internal static InvalidOperationException MethodCalledTwice ( string method )
109114 {
110115 InvalidOperationException e = new InvalidOperationException ( SR . GetString ( SR . ADP_CalledTwice , method ) ) ;
@@ -166,6 +171,11 @@ internal static ArgumentOutOfRangeException InvalidParameterDirection(ParameterD
166171 return InvalidEnumerationValue ( typeof ( ParameterDirection ) , ( int ) value ) ;
167172 }
168173
174+ internal static Exception TooManyRestrictions ( string collectionName )
175+ {
176+ return Argument ( SR . GetString ( SR . MDF_TooManyRestrictions , collectionName ) ) ;
177+ }
178+
169179
170180 // IDbCommand.UpdateRowSource
171181 internal static ArgumentOutOfRangeException InvalidUpdateRowSource ( UpdateRowSource value )
@@ -206,6 +216,11 @@ internal static Exception MethodNotImplemented([CallerMemberName] string methodN
206216 return NotImplemented . ByDesignWithMessage ( methodName ) ;
207217 }
208218
219+ internal static Exception QueryFailed ( string collectionName , Exception e )
220+ {
221+ return InvalidOperation ( SR . GetString ( SR . MDF_QueryFailed , collectionName ) , e ) ;
222+ }
223+
209224
210225 //
211226 // : DbConnectionOptions, DataAccess, SqlClient
@@ -251,6 +266,11 @@ internal static Exception CommandTextRequired(string method)
251266 return InvalidOperation ( SR . GetString ( SR . ADP_CommandTextRequired , method ) ) ;
252267 }
253268
269+ internal static Exception NoColumns ( )
270+ {
271+ return Argument ( SR . GetString ( SR . MDF_NoColumns ) ) ;
272+ }
273+
254274 internal static InvalidOperationException ConnectionRequired ( string method )
255275 {
256276 return InvalidOperation ( SR . GetString ( SR . ADP_ConnectionRequired , method ) ) ;
@@ -279,11 +299,21 @@ internal static Exception NonSeqByteAccess(long badIndex, long currIndex, string
279299 return InvalidOperation ( SR . GetString ( SR . ADP_NonSeqByteAccess , badIndex . ToString ( CultureInfo . InvariantCulture ) , currIndex . ToString ( CultureInfo . InvariantCulture ) , method ) ) ;
280300 }
281301
302+ internal static Exception InvalidXml ( )
303+ {
304+ return Argument ( SR . GetString ( SR . MDF_InvalidXml ) ) ;
305+ }
306+
282307 internal static Exception NegativeParameter ( string parameterName )
283308 {
284309 return InvalidOperation ( SR . GetString ( SR . ADP_NegativeParameter , parameterName ) ) ;
285310 }
286311
312+ internal static Exception InvalidXmlMissingColumn ( string collectionName , string columnName )
313+ {
314+ return Argument ( SR . GetString ( SR . MDF_InvalidXmlMissingColumn , collectionName , columnName ) ) ;
315+ }
316+
287317 //
288318 // SqlMetaData, SqlTypes, SqlClient
289319 //
@@ -297,6 +327,21 @@ internal static InvalidOperationException NonSequentialColumnAccess(int badCol,
297327 return InvalidOperation ( SR . GetString ( SR . ADP_NonSequentialColumnAccess , badCol . ToString ( CultureInfo . InvariantCulture ) , currCol . ToString ( CultureInfo . InvariantCulture ) ) ) ;
298328 }
299329
330+ internal static bool CompareInsensitiveInvariant ( string strvalue , string strconst )
331+ {
332+ return ( 0 == CultureInfo . InvariantCulture . CompareInfo . Compare ( strvalue , strconst , CompareOptions . IgnoreCase ) ) ;
333+ }
334+
335+ static internal Exception InvalidXmlInvalidValue ( string collectionName , string columnName )
336+ {
337+ return Argument ( SR . GetString ( SR . MDF_InvalidXmlInvalidValue , collectionName , columnName ) ) ;
338+ }
339+
340+ internal static Exception CollectionNameIsNotUnique ( string collectionName )
341+ {
342+ return Argument ( SR . GetString ( SR . MDF_CollectionNameISNotUnique , collectionName ) ) ;
343+ }
344+
300345
301346 //
302347 // : IDbCommand
@@ -309,10 +354,32 @@ internal static Exception UninitializedParameterSize(int index, Type dataType)
309354 {
310355 return InvalidOperation ( SR . GetString ( SR . ADP_UninitializedParameterSize , index . ToString ( CultureInfo . InvariantCulture ) , dataType . Name ) ) ;
311356 }
357+
358+ internal static Exception UnableToBuildCollection ( string collectionName )
359+ {
360+ return Argument ( SR . GetString ( SR . MDF_UnableToBuildCollection , collectionName ) ) ;
361+ }
362+
312363 internal static Exception PrepareParameterType ( DbCommand cmd )
313364 {
314365 return InvalidOperation ( SR . GetString ( SR . ADP_PrepareParameterType , cmd . GetType ( ) . Name ) ) ;
315366 }
367+
368+ internal static Exception UndefinedCollection ( string collectionName )
369+ {
370+ return Argument ( SR . GetString ( SR . MDF_UndefinedCollection , collectionName ) ) ;
371+ }
372+
373+ internal static Exception UnsupportedVersion ( string collectionName )
374+ {
375+ return Argument ( SR . GetString ( SR . MDF_UnsupportedVersion , collectionName ) ) ;
376+ }
377+
378+ internal static Exception AmbigousCollectionName ( string collectionName )
379+ {
380+ return Argument ( SR . GetString ( SR . MDF_AmbigousCollectionName , collectionName ) ) ;
381+ }
382+
316383 internal static Exception PrepareParameterSize ( DbCommand cmd )
317384 {
318385 return InvalidOperation ( SR . GetString ( SR . ADP_PrepareParameterSize , cmd . GetType ( ) . Name ) ) ;
@@ -321,6 +388,17 @@ internal static Exception PrepareParameterScale(DbCommand cmd, string type)
321388 {
322389 return InvalidOperation ( SR . GetString ( SR . ADP_PrepareParameterScale , cmd . GetType ( ) . Name , type ) ) ;
323390 }
391+
392+ internal static Exception MissingDataSourceInformationColumn ( )
393+ {
394+ return Argument ( SR . GetString ( SR . MDF_MissingDataSourceInformationColumn ) ) ;
395+ }
396+
397+ internal static Exception IncorrectNumberOfDataSourceInformationRows ( )
398+ {
399+ return Argument ( SR . GetString ( SR . MDF_IncorrectNumberOfDataSourceInformationRows ) ) ;
400+ }
401+
324402 internal static Exception MismatchedAsyncResult ( string expectedMethod , string gotMethod )
325403 {
326404 return InvalidOperation ( SR . GetString ( SR . ADP_MismatchedAsyncResult , expectedMethod , gotMethod ) ) ;
@@ -353,6 +431,12 @@ internal enum ConnectionError
353431 ConnectionOptionsMissing ,
354432 CouldNotSwitchToClosedPreviouslyOpenedState ,
355433 }
434+
435+ internal static Exception MissingRestrictionColumn ( )
436+ {
437+ return Argument ( SR . GetString ( SR . MDF_MissingRestrictionColumn ) ) ;
438+ }
439+
356440 internal static Exception InternalConnectionError ( ConnectionError internalError )
357441 {
358442 return InvalidOperation ( SR . GetString ( SR . ADP_InternalConnectionError , ( int ) internalError ) ) ;
@@ -363,6 +447,11 @@ internal static Exception InvalidConnectRetryCountValue()
363447 return Argument ( SR . GetString ( SR . SQLCR_InvalidConnectRetryCountValue ) ) ;
364448 }
365449
450+ internal static Exception MissingRestrictionRow ( )
451+ {
452+ return Argument ( SR . GetString ( SR . MDF_MissingRestrictionRow ) ) ;
453+ }
454+
366455 internal static Exception InvalidConnectRetryIntervalValue ( )
367456 {
368457 return Argument ( SR . GetString ( SR . SQLCR_InvalidConnectRetryIntervalValue ) ) ;
@@ -392,6 +481,12 @@ internal static ArgumentException UnknownDataType(Type dataType)
392481 {
393482 return Argument ( SR . GetString ( SR . ADP_UnknownDataType , dataType . FullName ) ) ;
394483 }
484+
485+ internal static bool IsEmptyArray ( string [ ] array )
486+ {
487+ return ( array == null || array . Length == 0 ) ;
488+ }
489+
395490 internal static ArgumentException DbTypeNotSupported ( DbType type , Type enumtype )
396491 {
397492 return Argument ( SR . GetString ( SR . ADP_DbTypeNotSupported , type . ToString ( ) , enumtype . Name ) ) ;
@@ -462,6 +557,12 @@ internal static Exception ParameterNull(string parameter, DbParameterCollection
462557 {
463558 return CollectionNullValue ( parameter , collection . GetType ( ) , parameterType ) ;
464559 }
560+
561+ internal static Exception UndefinedPopulationMechanism ( string populationMechanism )
562+ {
563+ throw new NotImplementedException ( ) ;
564+ }
565+
465566 internal static Exception InvalidParameterType ( DbParameterCollection collection , Type parameterType , object invalidValue )
466567 {
467568 return CollectionInvalidType ( collection . GetType ( ) , parameterType , invalidValue ) ;
0 commit comments