Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / Common / DBConnection.cs / 1 / DBConnection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Common { using System; using System.ComponentModel; using System.Data; #if WINFSInternalOnly internal #else public #endif abstract class DbConnection : Component, IDbConnection { // V1.2.3300 private StateChangeEventHandler _stateChangeEventHandler; protected DbConnection() : base() { } [ DefaultValue(""), RecommendedAsConfigurable(true), RefreshProperties(RefreshProperties.All), ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string ConnectionString { get; set; } [ ResCategoryAttribute(Res.DataCategory_Data), ] virtual public int ConnectionTimeout { get { return ADP.DefaultConnectionTimeout; } } [ ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string Database { get; } [ ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string DataSource { // NOTE: if you plan on allowing the data source to be changed, you // should implement a ChangeDataSource method, in keeping with // the ChangeDatabase method paradigm. get; } ////// The associated provider factory for derived class. /// virtual protected DbProviderFactory DbProviderFactory { get { return null; } } internal DbProviderFactory ProviderFactory { get { return DbProviderFactory; } } [ Browsable(false), ] abstract public string ServerVersion { get; } [ Browsable(false), ResDescriptionAttribute(Res.DbConnection_State), ] abstract public ConnectionState State { get; } [ ResCategoryAttribute(Res.DataCategory_StateChange), ResDescriptionAttribute(Res.DbConnection_StateChange), ] virtual public event StateChangeEventHandler StateChange { add { _stateChangeEventHandler += value; } remove { _stateChangeEventHandler -= value; } } abstract protected DbTransaction BeginDbTransaction(IsolationLevel isolationLevel); public DbTransaction BeginTransaction() { return BeginDbTransaction(IsolationLevel.Unspecified); } public DbTransaction BeginTransaction(IsolationLevel isolationLevel) { return BeginDbTransaction(isolationLevel); } IDbTransaction IDbConnection.BeginTransaction() { return BeginDbTransaction(IsolationLevel.Unspecified); } IDbTransaction IDbConnection.BeginTransaction(IsolationLevel isolationLevel) { return BeginDbTransaction(isolationLevel); } abstract public void Close(); abstract public void ChangeDatabase(string databaseName); public DbCommand CreateCommand() { return CreateDbCommand(); } IDbCommand IDbConnection.CreateCommand() { return CreateDbCommand(); } abstract protected DbCommand CreateDbCommand(); virtual public void EnlistTransaction(System.Transactions.Transaction transaction) { // NOTE: This is virtual because not all providers may choose to support // distributed transactions. throw ADP.NotSupported(); } // these need to be here so that GetSchema is visible when programming to a dbConnection object. // they are overridden by the real implementations in DbConnectionBase virtual public DataTable GetSchema() { throw ADP.NotSupported(); } virtual public DataTable GetSchema(string collectionName) { throw ADP.NotSupported(); } virtual public DataTable GetSchema(string collectionName, string[] restrictionValues ) { throw ADP.NotSupported(); } protected virtual void OnStateChange(StateChangeEventArgs stateChange) { StateChangeEventHandler handler = _stateChangeEventHandler; if (null != handler) { handler(this, stateChange); } } abstract public void Open(); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Common { using System; using System.ComponentModel; using System.Data; #if WINFSInternalOnly internal #else public #endif abstract class DbConnection : Component, IDbConnection { // V1.2.3300 private StateChangeEventHandler _stateChangeEventHandler; protected DbConnection() : base() { } [ DefaultValue(""), RecommendedAsConfigurable(true), RefreshProperties(RefreshProperties.All), ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string ConnectionString { get; set; } [ ResCategoryAttribute(Res.DataCategory_Data), ] virtual public int ConnectionTimeout { get { return ADP.DefaultConnectionTimeout; } } [ ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string Database { get; } [ ResCategoryAttribute(Res.DataCategory_Data), ] abstract public string DataSource { // NOTE: if you plan on allowing the data source to be changed, you // should implement a ChangeDataSource method, in keeping with // the ChangeDatabase method paradigm. get; } ////// The associated provider factory for derived class. /// virtual protected DbProviderFactory DbProviderFactory { get { return null; } } internal DbProviderFactory ProviderFactory { get { return DbProviderFactory; } } [ Browsable(false), ] abstract public string ServerVersion { get; } [ Browsable(false), ResDescriptionAttribute(Res.DbConnection_State), ] abstract public ConnectionState State { get; } [ ResCategoryAttribute(Res.DataCategory_StateChange), ResDescriptionAttribute(Res.DbConnection_StateChange), ] virtual public event StateChangeEventHandler StateChange { add { _stateChangeEventHandler += value; } remove { _stateChangeEventHandler -= value; } } abstract protected DbTransaction BeginDbTransaction(IsolationLevel isolationLevel); public DbTransaction BeginTransaction() { return BeginDbTransaction(IsolationLevel.Unspecified); } public DbTransaction BeginTransaction(IsolationLevel isolationLevel) { return BeginDbTransaction(isolationLevel); } IDbTransaction IDbConnection.BeginTransaction() { return BeginDbTransaction(IsolationLevel.Unspecified); } IDbTransaction IDbConnection.BeginTransaction(IsolationLevel isolationLevel) { return BeginDbTransaction(isolationLevel); } abstract public void Close(); abstract public void ChangeDatabase(string databaseName); public DbCommand CreateCommand() { return CreateDbCommand(); } IDbCommand IDbConnection.CreateCommand() { return CreateDbCommand(); } abstract protected DbCommand CreateDbCommand(); virtual public void EnlistTransaction(System.Transactions.Transaction transaction) { // NOTE: This is virtual because not all providers may choose to support // distributed transactions. throw ADP.NotSupported(); } // these need to be here so that GetSchema is visible when programming to a dbConnection object. // they are overridden by the real implementations in DbConnectionBase virtual public DataTable GetSchema() { throw ADP.NotSupported(); } virtual public DataTable GetSchema(string collectionName) { throw ADP.NotSupported(); } virtual public DataTable GetSchema(string collectionName, string[] restrictionValues ) { throw ADP.NotSupported(); } protected virtual void OnStateChange(StateChangeEventArgs stateChange) { StateChangeEventHandler handler = _stateChangeEventHandler; if (null != handler) { handler(this, stateChange); } } abstract public void Open(); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeLabeledStatement.cs
- HtmlImage.cs
- COM2ColorConverter.cs
- HtmlWindowCollection.cs
- HttpConfigurationSystem.cs
- RectAnimationClockResource.cs
- XmlSigningNodeWriter.cs
- TripleDESCryptoServiceProvider.cs
- ButtonBaseAdapter.cs
- OleDbSchemaGuid.cs
- OdbcConnectionFactory.cs
- BitVec.cs
- SecurityContextSecurityTokenParameters.cs
- ObjectView.cs
- UnsafeNativeMethodsPenimc.cs
- DataSourceControl.cs
- MergeExecutor.cs
- ObjectParameterCollection.cs
- Point3DAnimationBase.cs
- UnsafeNativeMethods.cs
- DispatcherExceptionEventArgs.cs
- IPCCacheManager.cs
- EncodingInfo.cs
- IdentityModelStringsVersion1.cs
- FtpWebResponse.cs
- SQLMoneyStorage.cs
- InvalidOperationException.cs
- GenericTypeParameterBuilder.cs
- CompositeActivityValidator.cs
- AvTraceFormat.cs
- StatusBarPanelClickEvent.cs
- metadatamappinghashervisitor.cs
- _ServiceNameStore.cs
- SoapAttributes.cs
- SqlWebEventProvider.cs
- UrlMappingsSection.cs
- GregorianCalendar.cs
- QilTypeChecker.cs
- SoapRpcServiceAttribute.cs
- WorkflowQueue.cs
- XmlTypeAttribute.cs
- KeySplineConverter.cs
- FileSystemInfo.cs
- CompiledRegexRunnerFactory.cs
- CommonDialog.cs
- Point3DAnimationBase.cs
- TextBoxAutomationPeer.cs
- PermissionListSet.cs
- ApplicationId.cs
- SQLChars.cs
- ToolboxDataAttribute.cs
- SpoolingTaskBase.cs
- DoubleLinkList.cs
- DispatcherExceptionFilterEventArgs.cs
- Sentence.cs
- Clipboard.cs
- SafeCoTaskMem.cs
- CounterSampleCalculator.cs
- Point.cs
- ValidationVisibilityAttribute.cs
- ContextMenu.cs
- MediaSystem.cs
- DataGrid.cs
- DataSourceDescriptorCollection.cs
- DesignerResources.cs
- SourceSwitch.cs
- SurrogateEncoder.cs
- MimeWriter.cs
- CodeValidator.cs
- EventLogPermissionEntryCollection.cs
- DialogWindow.cs
- HandledMouseEvent.cs
- XmlSchemaException.cs
- WebRequestModuleElementCollection.cs
- XmlILConstructAnalyzer.cs
- FusionWrap.cs
- GridViewSelectEventArgs.cs
- Subtree.cs
- Region.cs
- NativeMethods.cs
- ExpressionValueEditor.cs
- DataIdProcessor.cs
- TrustLevelCollection.cs
- PrivilegedConfigurationManager.cs
- PackWebRequestFactory.cs
- EntryIndex.cs
- WeakReferenceList.cs
- CompilerLocalReference.cs
- QueryResponse.cs
- RoleProviderPrincipal.cs
- TextInfo.cs
- ControlBindingsCollection.cs
- ProfessionalColors.cs
- SqlParameterizer.cs
- SQLBinaryStorage.cs
- QilXmlReader.cs
- Rect3D.cs
- PropertyGrid.cs
- Point3DConverter.cs
- Zone.cs