Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Data / System / Data / Common / DBConnection.cs / 2 / 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.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OutputScopeManager.cs
- NativeMethods.cs
- DataGridViewColumnConverter.cs
- DataGridBoolColumn.cs
- WebPartMinimizeVerb.cs
- PartialClassGenerationTask.cs
- DataServiceKeyAttribute.cs
- EventBuilder.cs
- SqlDataSource.cs
- FormsAuthenticationTicket.cs
- EnumerableWrapperWeakToStrong.cs
- GroupBoxAutomationPeer.cs
- BitmapEffectInput.cs
- WebHttpElement.cs
- WindowsSysHeader.cs
- QueryHandler.cs
- BaseParser.cs
- HttpRequestTraceRecord.cs
- InkPresenter.cs
- PageSettings.cs
- ValueExpressions.cs
- ByteFacetDescriptionElement.cs
- PropertyPushdownHelper.cs
- XmlAttributes.cs
- CombinedGeometry.cs
- GridLengthConverter.cs
- ColorTransformHelper.cs
- XmlSchemaChoice.cs
- FileDialog.cs
- WebPartConnectionCollection.cs
- BitmapPalettes.cs
- MouseWheelEventArgs.cs
- AuthStoreRoleProvider.cs
- DesignerMetadata.cs
- DictionaryEntry.cs
- EntityTypeEmitter.cs
- Matrix3DStack.cs
- BeginStoryboard.cs
- ISessionStateStore.cs
- DataControlReference.cs
- SendingRequestEventArgs.cs
- SqlDataSourceCommandParser.cs
- Win32PrintDialog.cs
- InternalControlCollection.cs
- ScriptResourceInfo.cs
- DeleteStoreRequest.cs
- XmlAttributeProperties.cs
- CategoryNameCollection.cs
- ToolStripDropDown.cs
- ToolStripSystemRenderer.cs
- KoreanLunisolarCalendar.cs
- TextChangedEventArgs.cs
- SafeEventLogReadHandle.cs
- Int32Animation.cs
- MediaTimeline.cs
- HtmlInputCheckBox.cs
- MediaEntryAttribute.cs
- MachinePropertyVariants.cs
- PreparingEnlistment.cs
- BaseParser.cs
- SqlProfileProvider.cs
- XamlRtfConverter.cs
- WsatConfiguration.cs
- TransformerTypeCollection.cs
- EnterpriseServicesHelper.cs
- VisualCollection.cs
- DropDownList.cs
- ParamArrayAttribute.cs
- SerialPort.cs
- CodeExpressionStatement.cs
- ContextActivityUtils.cs
- TemplateParser.cs
- OracleInfoMessageEventArgs.cs
- ErrorTableItemStyle.cs
- COM2Properties.cs
- PropertyIDSet.cs
- MaskedTextBoxTextEditorDropDown.cs
- LinkLabelLinkClickedEvent.cs
- CacheMemory.cs
- InputElement.cs
- WebPartDescriptionCollection.cs
- PointCollectionConverter.cs
- CompiledQueryCacheEntry.cs
- Native.cs
- DecoderNLS.cs
- ValueExpressions.cs
- SqlProfileProvider.cs
- SourceFileBuildProvider.cs
- ToolStripControlHost.cs
- DataGridColumn.cs
- DbFunctionCommandTree.cs
- AttributeEmitter.cs
- WindowsContainer.cs
- versioninfo.cs
- WebPartAddingEventArgs.cs
- XmlSchemaSimpleTypeUnion.cs
- ResizeGrip.cs
- BrowserCapabilitiesFactoryBase.cs
- ParameterReplacerVisitor.cs
- SystemIPv4InterfaceProperties.cs