wasCSharpSQLite
/trunk/System.Data.Ersatz/Silverlight/Properties/AssemblyInfo.cs |
---|
@@ -0,0 +1,31 @@ |
// |
// AssemblyInfo.cs |
// |
// Author: |
// Andreas Nahr (ClassDevelopment@A-SoftTech.com) |
// |
// (C) 2003 Ximian, Inc. http://www.ximian.com |
// (C) 2004 Novell (http://www.novell.com) |
// |
using System; |
using System.Reflection; |
using System.Runtime.InteropServices; |
[assembly: AssemblyVersion("3.7.5.0")] |
/* TODO COMPLETE INFORMATION |
[assembly: AssemblyTitle ("")] |
[assembly: AssemblyDescription ("")] |
[assembly: CLSCompliant (true)] |
[assembly: AssemblyFileVersion ("0.0.0.1")] |
[assembly: ComVisible (false)] |
[assembly: AssemblyDelaySign (true)] |
[assembly: AssemblyKeyFile ("../mono.pub")] |
*/ |
/trunk/System.Data.Ersatz/Silverlight/System.Data.Ersatz.Silverlight.csproj |
---|
@@ -0,0 +1,154 @@ |
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<PropertyGroup> |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<ProductVersion>8.0.50727</ProductVersion> |
<SchemaVersion>2.0</SchemaVersion> |
<ProjectGuid>{D7194231-DBAD-422B-819E-911037934F45}</ProjectGuid> |
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> |
<OutputType>Library</OutputType> |
<AppDesignerFolder>Properties</AppDesignerFolder> |
<RootNamespace>System</RootNamespace> |
<AssemblyName>System.Data.Ersatz</AssemblyName> |
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> |
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> |
<SilverlightApplication>false</SilverlightApplication> |
<ValidateXaml>true</ValidateXaml> |
<ThrowErrorsInValidation>true</ThrowErrorsInValidation> |
</PropertyGroup> |
<!-- This property group is only here to support building this project using the |
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs |
to set the TargetFrameworkVersion to v3.5 --> |
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> |
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
<DebugSymbols>true</DebugSymbols> |
<DebugType>full</DebugType> |
<Optimize>false</Optimize> |
<OutputPath>Bin\Debug</OutputPath> |
<DefineConstants>TRACE;DEBUG;SQLITE_SILVERLIGHT SQLITE_HAS_CODEC NET_2_0</DefineConstants> |
<NoStdLib>true</NoStdLib> |
<NoConfig>true</NoConfig> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
<DebugType>pdbonly</DebugType> |
<Optimize>true</Optimize> |
<OutputPath>Bin\Release</OutputPath> |
<DefineConstants>TRACE;SQLITE_SILVERLIGHT</DefineConstants> |
<NoStdLib>true</NoStdLib> |
<NoConfig>true</NoConfig> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<ItemGroup> |
<Reference Include="mscorlib" /> |
<Reference Include="system" /> |
</ItemGroup> |
<ItemGroup> |
<Compile Include="..\src\System.Data.Common\DbCommand.cs"> |
<Link>System.Data.Common\DbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbConnection.cs"> |
<Link>System.Data.Common\DbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataReader.cs"> |
<Link>System.Data.Common\DbDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataRecord.cs"> |
<Link>System.Data.Common\DbDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbEnumerator.cs"> |
<Link>System.Data.Common\DbEnumerator.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbException.cs"> |
<Link>System.Data.Common\DbException.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameter.cs"> |
<Link>System.Data.Common\DbParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameterCollection.cs"> |
<Link>System.Data.Common\DbParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTransaction.cs"> |
<Link>System.Data.Common\DbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTypes.cs"> |
<Link>System.Data.Common\DbTypes.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\SchemaInfo.cs"> |
<Link>System.Data.Common\SchemaInfo.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandBehavior.cs"> |
<Link>System.Data\CommandBehavior.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandType.cs"> |
<Link>System.Data\CommandType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ConnectionState.cs"> |
<Link>System.Data\ConnectionState.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\DbType.cs"> |
<Link>System.Data\DbType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameter.cs"> |
<Link>System.Data\IDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameterCollection.cs"> |
<Link>System.Data\IDataParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataReader.cs"> |
<Link>System.Data\IDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataRecord.cs"> |
<Link>System.Data\IDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbCommand.cs"> |
<Link>System.Data\IDbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbConnection.cs"> |
<Link>System.Data\IDbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbDataParameter.cs"> |
<Link>System.Data\IDbDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbTransaction.cs"> |
<Link>System.Data\IDbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IsolationLevel.cs"> |
<Link>System.Data\IsolationLevel.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ParameterDirection.cs"> |
<Link>System.Data\ParameterDirection.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ApplicationException.cs"> |
<Link>System\ApplicationException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\DuplicateNameException.cs"> |
<Link>System\DuplicateNameException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ICloneable.cs"> |
<Link>System\ICloneable.cs</Link> |
</Compile> |
<Compile Include="Properties\AssemblyInfo.cs" /> |
</ItemGroup> |
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" /> |
<ProjectExtensions> |
<VisualStudio> |
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> |
<SilverlightProjectProperties /> |
</FlavorProperties> |
</VisualStudio> |
</ProjectExtensions> |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
Other similar extension points exist, see Microsoft.Common.targets. |
<Target Name="BeforeBuild"> |
</Target> |
<Target Name="AfterBuild"> |
</Target> |
--> |
</Project> |
/trunk/System.Data.Ersatz/WinPhone/Properties/AssemblyInfo.cs |
---|
@@ -0,0 +1,31 @@ |
// |
// AssemblyInfo.cs |
// |
// Author: |
// Andreas Nahr (ClassDevelopment@A-SoftTech.com) |
// |
// (C) 2003 Ximian, Inc. http://www.ximian.com |
// (C) 2004 Novell (http://www.novell.com) |
// |
using System; |
using System.Reflection; |
using System.Runtime.InteropServices; |
[assembly: AssemblyVersion("3.7.5.0")] |
/* TODO COMPLETE INFORMATION |
[assembly: AssemblyTitle ("")] |
[assembly: AssemblyDescription ("")] |
[assembly: CLSCompliant (true)] |
[assembly: AssemblyFileVersion ("0.0.0.1")] |
[assembly: ComVisible (false)] |
[assembly: AssemblyDelaySign (true)] |
[assembly: AssemblyKeyFile ("../mono.pub")] |
*/ |
/trunk/System.Data.Ersatz/WinPhone/System.Data.Ersatz.WinPhone.csproj |
---|
@@ -0,0 +1,145 @@ |
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<PropertyGroup> |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<ProductVersion>10.0.20506</ProductVersion> |
<SchemaVersion>2.0</SchemaVersion> |
<ProjectGuid>{60396C62-02C2-45FE-98BD-4A16E076722B}</ProjectGuid> |
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> |
<OutputType>Library</OutputType> |
<AppDesignerFolder>Properties</AppDesignerFolder> |
<RootNamespace>System.Data.Ersatz.WinPhone</RootNamespace> |
<AssemblyName>System.Data.Ersatz.WinPhone</AssemblyName> |
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> |
<TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile> |
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> |
<SilverlightApplication>false</SilverlightApplication> |
<ValidateXaml>true</ValidateXaml> |
<ThrowErrorsInValidation>true</ThrowErrorsInValidation> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
<DebugSymbols>true</DebugSymbols> |
<DebugType>full</DebugType> |
<Optimize>false</Optimize> |
<OutputPath>Bin\Debug</OutputPath> |
<DefineConstants>TRACE;DEBUG;SQLITE_SILVERLIGHT NET_40 TRUE WIN32 _MSC_VER SQLITE_DEBUG NDEBUG NO_TCL SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MEM_POOL SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF WINDOWS_PHONE</DefineConstants> |
<NoStdLib>true</NoStdLib> |
<NoConfig>true</NoConfig> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
<DebugType>pdbonly</DebugType> |
<Optimize>true</Optimize> |
<OutputPath>Bin\Release</OutputPath> |
<DefineConstants>TRACE;SQLITE_SILVERLIGHT;WINDOWS_PHONE</DefineConstants> |
<NoStdLib>true</NoStdLib> |
<NoConfig>true</NoConfig> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<ItemGroup> |
<Reference Include="system" /> |
<Reference Include="System.Core" /> |
</ItemGroup> |
<ItemGroup> |
<Compile Include="..\src\System.Data.Common\DbCommand.cs"> |
<Link>System.Data.Common\DbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbConnection.cs"> |
<Link>System.Data.Common\DbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataReader.cs"> |
<Link>System.Data.Common\DbDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataRecord.cs"> |
<Link>System.Data.Common\DbDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbEnumerator.cs"> |
<Link>System.Data.Common\DbEnumerator.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbException.cs"> |
<Link>System.Data.Common\DbException.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameter.cs"> |
<Link>System.Data.Common\DbParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameterCollection.cs"> |
<Link>System.Data.Common\DbParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTransaction.cs"> |
<Link>System.Data.Common\DbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTypes.cs"> |
<Link>System.Data.Common\DbTypes.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\SchemaInfo.cs"> |
<Link>System.Data.Common\SchemaInfo.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandBehavior.cs"> |
<Link>System.Data\CommandBehavior.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandType.cs"> |
<Link>System.Data\CommandType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ConnectionState.cs"> |
<Link>System.Data\ConnectionState.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\DbType.cs"> |
<Link>System.Data\DbType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameter.cs"> |
<Link>System.Data\IDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameterCollection.cs"> |
<Link>System.Data\IDataParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataReader.cs"> |
<Link>System.Data\IDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataRecord.cs"> |
<Link>System.Data\IDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbCommand.cs"> |
<Link>System.Data\IDbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbConnection.cs"> |
<Link>System.Data\IDbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbDataParameter.cs"> |
<Link>System.Data\IDbDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbTransaction.cs"> |
<Link>System.Data\IDbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IsolationLevel.cs"> |
<Link>System.Data\IsolationLevel.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ParameterDirection.cs"> |
<Link>System.Data\ParameterDirection.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ApplicationException.cs"> |
<Link>System\ApplicationException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\DuplicateNameException.cs"> |
<Link>System\DuplicateNameException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ICloneable.cs"> |
<Link>System\ICloneable.cs</Link> |
</Compile> |
<Compile Include="Properties\AssemblyInfo.cs" /> |
</ItemGroup> |
<ItemGroup /> |
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" /> |
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" /> |
<ProjectExtensions /> |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
Other similar extension points exist, see Microsoft.Common.targets. |
<Target Name="BeforeBuild"> |
</Target> |
<Target Name="AfterBuild"> |
</Target> |
--> |
</Project> |
/trunk/System.Data.Ersatz/WinRT/Properties/AssemblyInfo.cs |
---|
@@ -0,0 +1,29 @@ |
using System.Reflection; |
using System.Runtime.CompilerServices; |
using System.Runtime.InteropServices; |
// General Information about an assembly is controlled through the following |
// set of attributes. Change these attribute values to modify the information |
// associated with an assembly. |
[assembly: AssemblyTitle("System.Data.Ersatz.WinRT")] |
[assembly: AssemblyDescription("")] |
[assembly: AssemblyConfiguration("")] |
[assembly: AssemblyCompany("")] |
[assembly: AssemblyProduct("System.Data.Ersatz.WinRT")] |
[assembly: AssemblyCopyright("Copyright © 2012")] |
[assembly: AssemblyTrademark("")] |
[assembly: AssemblyCulture("")] |
// Version information for an assembly consists of the following four values: |
// |
// Major Version |
// Minor Version |
// Build Number |
// Revision |
// |
// You can specify all the values or you can default the Build and Revision Numbers |
// by using the '*' as shown below: |
// [assembly: AssemblyVersion("1.0.*")] |
[assembly: AssemblyVersion("1.0.0.0")] |
[assembly: AssemblyFileVersion("1.0.0.0")] |
[assembly: ComVisible(false)] |
/trunk/System.Data.Ersatz/WinRT/System.Data.Ersatz.WinRT.csproj |
---|
@@ -0,0 +1,211 @@ |
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
<PropertyGroup> |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<ProductVersion>8.0.30703</ProductVersion> |
<SchemaVersion>2.0</SchemaVersion> |
<ProjectGuid>{6191A053-0255-4509-B7C0-11C6C3D4E66B}</ProjectGuid> |
<OutputType>Library</OutputType> |
<AppDesignerFolder>Properties</AppDesignerFolder> |
<RootNamespace>System.Data.Ersatz.WinRT</RootNamespace> |
<AssemblyName>System.Data.Ersatz.WinRT</AssemblyName> |
<DefaultLanguage>en-US</DefaultLanguage> |
<FileAlignment>512</FileAlignment> |
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
<DebugSymbols>true</DebugSymbols> |
<DebugType>full</DebugType> |
<Optimize>false</Optimize> |
<OutputPath>bin\Debug\</OutputPath> |
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
<DebugType>pdbonly</DebugType> |
<Optimize>true</Optimize> |
<OutputPath>bin\Release\</OutputPath> |
<DefineConstants>TRACE;NETFX_CORE</DefineConstants> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> |
<DebugSymbols>true</DebugSymbols> |
<OutputPath>bin\ARM\Debug\</OutputPath> |
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants> |
<NoWarn>;2008</NoWarn> |
<DebugType>full</DebugType> |
<PlatformTarget>ARM</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'"> |
<OutputPath>bin\ARM\Release\</OutputPath> |
<DefineConstants>TRACE;NETFX_CORE</DefineConstants> |
<Optimize>true</Optimize> |
<NoWarn>;2008</NoWarn> |
<DebugType>pdbonly</DebugType> |
<PlatformTarget>ARM</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> |
<DebugSymbols>true</DebugSymbols> |
<OutputPath>bin\x64\Debug\</OutputPath> |
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants> |
<NoWarn>;2008</NoWarn> |
<DebugType>full</DebugType> |
<PlatformTarget>x64</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> |
<OutputPath>bin\x64\Release\</OutputPath> |
<DefineConstants>TRACE;NETFX_CORE</DefineConstants> |
<Optimize>true</Optimize> |
<NoWarn>;2008</NoWarn> |
<DebugType>pdbonly</DebugType> |
<PlatformTarget>x64</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> |
<DebugSymbols>true</DebugSymbols> |
<OutputPath>bin\x86\Debug\</OutputPath> |
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants> |
<NoWarn>;2008</NoWarn> |
<DebugType>full</DebugType> |
<PlatformTarget>x86</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> |
<OutputPath>bin\x86\Release\</OutputPath> |
<DefineConstants>TRACE;NETFX_CORE</DefineConstants> |
<Optimize>true</Optimize> |
<NoWarn>;2008</NoWarn> |
<DebugType>pdbonly</DebugType> |
<PlatformTarget>x86</PlatformTarget> |
<UseVSHostingProcess>false</UseVSHostingProcess> |
<ErrorReport>prompt</ErrorReport> |
<CodeAnalysisRuleSet>ExpressRules.ruleset</CodeAnalysisRuleSet> |
<Prefer32Bit>true</Prefer32Bit> |
</PropertyGroup> |
<ItemGroup> |
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included --> |
</ItemGroup> |
<ItemGroup> |
<Compile Include="..\src\System.Data.Common\DbCommand.cs"> |
<Link>System.Data.Common\DbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbConnection.cs"> |
<Link>System.Data.Common\DbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataReader.cs"> |
<Link>System.Data.Common\DbDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbDataRecord.cs"> |
<Link>System.Data.Common\DbDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbEnumerator.cs"> |
<Link>System.Data.Common\DbEnumerator.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbException.cs"> |
<Link>System.Data.Common\DbException.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameter.cs"> |
<Link>System.Data.Common\DbParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbParameterCollection.cs"> |
<Link>System.Data.Common\DbParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTransaction.cs"> |
<Link>System.Data.Common\DbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\DbTypes.cs"> |
<Link>System.Data.Common\DbTypes.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data.Common\SchemaInfo.cs"> |
<Link>System.Data.Common\SchemaInfo.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandBehavior.cs"> |
<Link>System.Data\CommandBehavior.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\CommandType.cs"> |
<Link>System.Data\CommandType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ConnectionState.cs"> |
<Link>System.Data\ConnectionState.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\DbType.cs"> |
<Link>System.Data\DbType.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameter.cs"> |
<Link>System.Data\IDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataParameterCollection.cs"> |
<Link>System.Data\IDataParameterCollection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataReader.cs"> |
<Link>System.Data\IDataReader.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDataRecord.cs"> |
<Link>System.Data\IDataRecord.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbCommand.cs"> |
<Link>System.Data\IDbCommand.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbConnection.cs"> |
<Link>System.Data\IDbConnection.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbDataParameter.cs"> |
<Link>System.Data\IDbDataParameter.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IDbTransaction.cs"> |
<Link>System.Data\IDbTransaction.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\IsolationLevel.cs"> |
<Link>System.Data\IsolationLevel.cs</Link> |
</Compile> |
<Compile Include="..\src\System.Data\ParameterDirection.cs"> |
<Link>System.Data\ParameterDirection.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ApplicationException.cs"> |
<Link>System\ApplicationException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\DBNull.cs"> |
<Link>System\DBNull.cs</Link> |
</Compile> |
<Compile Include="..\src\System\DuplicateNameException.cs"> |
<Link>System\DuplicateNameException.cs</Link> |
</Compile> |
<Compile Include="..\src\System\ICloneable.cs"> |
<Link>System\ICloneable.cs</Link> |
</Compile> |
<Compile Include="Properties\AssemblyInfo.cs" /> |
</ItemGroup> |
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' "> |
<VisualStudioVersion>11.0</VisualStudioVersion> |
</PropertyGroup> |
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
Other similar extension points exist, see Microsoft.Common.targets. |
<Target Name="BeforeBuild"> |
</Target> |
<Target Name="AfterBuild"> |
</Target> |
--> |
</Project> |
/trunk/System.Data.Ersatz/src/System/ApplicationException.cs |
---|
@@ -0,0 +1,25 @@ |
using System; |
namespace System |
{ |
public class ApplicationException :Exception |
{ |
public ApplicationException() |
: base() |
{ |
} |
public ApplicationException(string message) |
: base(message) |
{ |
} |
public ApplicationException(string message, Exception innerException) |
: base(message, innerException) |
{ |
} |
} |
} |
/trunk/System.Data.Ersatz/src/System/DBNull.cs |
---|
@@ -0,0 +1,18 @@ |
namespace System |
{ |
public sealed class DBNull |
{ |
// Fields |
public static readonly DBNull Value = new DBNull (); |
// Private constructor |
private DBNull () |
{ |
} |
public override string ToString () |
{ |
return String.Empty; |
} |
} |
} |
/trunk/System.Data.Ersatz/src/System/DuplicateNameException.cs |
---|
@@ -0,0 +1,17 @@ |
using System; |
namespace System |
{ |
public class DuplicateNameException :Exception |
{ |
public DuplicateNameException() |
{ |
} |
public DuplicateNameException(string ErrorMessage) |
{ |
} |
} |
} |
/trunk/System.Data.Ersatz/src/System/ICloneable.cs |
---|
@@ -0,0 +1,12 @@ |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
namespace System |
{ |
public interface ICloneable |
{ |
object Clone(); |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/CommandBehavior.cs |
---|
@@ -0,0 +1,51 @@ |
// |
// System.Data.CommandBehavior.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
namespace System.Data |
{ |
/// <summary> |
/// Specifies a description of the results and the affect on the database of the query command. |
/// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values. |
/// </summary> |
[Flags] |
public enum CommandBehavior |
{ |
Default = 0, |
SingleResult = 1, |
SchemaOnly = 2, |
KeyInfo = 4, |
SingleRow = 8, |
SequentialAccess = 16, |
CloseConnection = 32 |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/CommandType.cs |
---|
@@ -0,0 +1,9 @@ |
namespace System.Data |
{ |
public enum CommandType |
{ |
StoredProcedure = 4, |
TableDirect = 512, |
Text = 1 |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/ConnectionState.cs |
---|
@@ -0,0 +1,14 @@ |
namespace System.Data |
{ |
public enum ConnectionState |
{ |
Broken = 16, |
Closed = 0, |
Connecting = 2, |
Executing = 4, |
Fetching = 8, |
Open = 1 |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/DbType.cs |
---|
@@ -0,0 +1,18 @@ |
namespace System.Data |
{ |
public enum DbType |
{ |
Guid, |
String, |
Boolean, |
DateTime, |
Single, |
Double, |
Int16, |
Int32, |
Int64, |
Byte, |
Binary, |
Decimal |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDataParameter.cs |
---|
@@ -0,0 +1,59 @@ |
// |
// System.Data.IDataParameter.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data |
{ |
/// <summary> |
/// Represents a parameter to a Command object, and optionally, its mapping to DataSet columns; and is implemented by .NET data providers that access data sources. |
/// </summary> |
public interface IDataParameter |
{ |
DbType DbType{get;set;} |
ParameterDirection Direction{get;set;} |
bool IsNullable{get;} |
string ParameterName{get;set;} |
string SourceColumn{get;set;} |
//DataRowVersion SourceVersion {get;set;} |
object Value {get;set;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDataParameterCollection.cs |
---|
@@ -0,0 +1,51 @@ |
// |
// System.Data.IDataParameterCollection.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
using System.Collections; |
namespace System.Data |
{ |
/// <summary> |
/// Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET data providers that access data sources. |
/// </summary> |
public interface IDataParameterCollection : IList, ICollection, IEnumerable |
{ |
void RemoveAt(string parameterName); |
int IndexOf(string parameterName); |
bool Contains(string parameterName); |
object this[string parameterName]{get; set;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDataReader.cs |
---|
@@ -0,0 +1,55 @@ |
// |
// System.Data.IDataReader.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
namespace System.Data |
{ |
/// <summary> |
/// Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET data providers that access relational databases. |
/// </summary> |
public interface IDataReader : IDisposable, IDataRecord |
{ |
void Close(); |
bool NextResult(); |
bool Read(); |
int Depth{get;} |
bool IsClosed{get;} |
int RecordsAffected{get;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDataRecord.cs |
---|
@@ -0,0 +1,94 @@ |
// |
// System.Data.IDataRecord.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
namespace System.Data |
{ |
/// <summary> |
/// Provides access to the column values within |
/// each row for a DataReader, and is implemented by .NET data |
/// providers that access relational databases. |
/// </summary> |
public interface IDataRecord |
{ |
bool GetBoolean(int i); |
byte GetByte(int i); |
long GetBytes(int i, long fieldOffset, byte[] buffer, |
int bufferoffset, int length); |
char GetChar(int i); |
long GetChars (int i, long fieldoffset, char [] buffer, |
int bufferoffset, int length); |
IDataReader GetData(int i); |
string GetDataTypeName(int i); |
DateTime GetDateTime(int i); |
decimal GetDecimal(int i); |
double GetDouble(int i); |
Type GetFieldType(int i); |
float GetFloat(int i); |
Guid GetGuid(int i); |
short GetInt16(int i); |
int GetInt32(int i); |
long GetInt64(int i); |
string GetName(int i); |
int GetOrdinal(string name); |
string GetString(int i); |
object GetValue(int i); |
int GetValues(object[] values); |
bool IsDBNull(int i); |
int FieldCount{get;} |
object this[string name]{get;} |
object this[int i]{get;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDbCommand.cs |
---|
@@ -0,0 +1,70 @@ |
// |
// System.Data.IDBCommand.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data |
{ |
/// <summary> |
/// Represents a SQL statement that is executed while connected to a data source, and is implemented by .NET data providers that access relational databases. |
/// </summary> |
public interface IDbCommand : IDisposable |
{ |
void Cancel(); |
IDbDataParameter CreateParameter(); |
int ExecuteNonQuery(); |
IDataReader ExecuteReader(); |
IDataReader ExecuteReader(CommandBehavior behavior); |
object ExecuteScalar(); |
void Prepare(); |
string CommandText{get; set;} |
int CommandTimeout{get; set;} |
CommandType CommandType{get; set;} |
IDbConnection Connection{get; set;} |
IDataParameterCollection Parameters{get;} |
IDbTransaction Transaction{get; set;} |
//UpdateRowSource UpdatedRowSource{get; set;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDbConnection.cs |
---|
@@ -0,0 +1,64 @@ |
// |
// System.Data.IDBConnection.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data |
{ |
/// <summary> |
/// Represents an open connection to a data source, and is implemented by .NET data providers that access relational databases. |
/// </summary> |
public interface IDbConnection : IDisposable |
{ |
IDbTransaction BeginTransaction(); |
IDbTransaction BeginTransaction(IsolationLevel il); |
void ChangeDatabase(string databaseName); |
void Close(); |
IDbCommand CreateCommand(); |
void Open(); |
string ConnectionString{get; set;} |
int ConnectionTimeout{get;} |
string Database{get;} |
ConnectionState State{get;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDbDataParameter.cs |
---|
@@ -0,0 +1,48 @@ |
// |
// System.Data.IDbDataParameter.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data |
{ |
/// <summary> |
/// Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns. |
/// </summary> |
public interface IDbDataParameter : IDataParameter |
{ |
byte Precision{get; set;} |
byte Scale{get; set;} |
int Size{get; set;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IDbTransaction.cs |
---|
@@ -0,0 +1,50 @@ |
// |
// System.Data.IDbTransaction.cs |
// |
// Author: |
// Christopher Podurgiel (cpodurgiel@msn.com) |
// |
// (C) Chris Podurgiel |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data |
{ |
/// <summary> |
/// Represents a transaction to be performed at a data source, and is implemented by .NET data providers that access relational databases. |
/// </summary> |
public interface IDbTransaction : IDisposable |
{ |
void Commit(); |
void Rollback(); |
IDbConnection Connection{get;} |
IsolationLevel IsolationLevel{get;} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/IsolationLevel.cs |
---|
@@ -0,0 +1,13 @@ |
namespace System.Data |
{ |
public enum IsolationLevel |
{ |
Chaos = 16, |
ReadCommitted = 4096, |
ReadUncommitted = 256, |
RepeatableRead = 65536, |
Serializable = 1048576, |
Snapshot = 16777216, |
Unspecified = -1 |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data/ParameterDirection.cs |
---|
@@ -0,0 +1,10 @@ |
namespace System.Data |
{ |
public enum ParameterDirection |
{ |
Input = 1, |
InputOutput = 3, |
Output = 2, |
ReturnValue = 6 |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbCommand.cs |
---|
@@ -0,0 +1,185 @@ |
// |
// System.Data.Common.DbCommand |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.ComponentModel; |
using System.Data; |
namespace System.Data.Common { |
public abstract class DbCommand : IDbCommand, IDisposable |
{ |
protected DbCommand () |
{ |
} |
#region Properties |
[DefaultValue ("")] |
public abstract string CommandText { get; set; } |
public abstract int CommandTimeout { get; set; } |
[DefaultValue (CommandType.Text)] |
public abstract CommandType CommandType { get; set; } |
[DefaultValue (null)] |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public DbConnection Connection { |
get { return DbConnection; } |
set { DbConnection = value; } |
} |
protected abstract DbConnection DbConnection { get; set; } |
protected abstract DbParameterCollection DbParameterCollection { get; } |
protected abstract DbTransaction DbTransaction { get; set; } |
[EditorBrowsable (EditorBrowsableState.Never)] |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[DefaultValue (true)] |
public abstract bool DesignTimeVisible { get; set; } |
IDbConnection IDbCommand.Connection { |
get { return Connection; } |
set { Connection = (DbConnection) value; } |
} |
IDataParameterCollection IDbCommand.Parameters { |
get { return Parameters; } |
} |
IDbTransaction IDbCommand.Transaction { |
get { return Transaction; } |
set { Transaction = (DbTransaction) value; } |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public DbParameterCollection Parameters { |
get { return DbParameterCollection; } |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[DefaultValue (null)] |
public DbTransaction Transaction { |
get { return DbTransaction; } |
set { DbTransaction = value; } |
} |
//[DefaultValue (UpdateRowSource.Both)] |
//public abstract UpdateRowSource UpdatedRowSource { get; set; } |
#endregion // Properties |
#region Methods |
public abstract void Cancel (); |
protected abstract DbParameter CreateDbParameter (); |
public DbParameter CreateParameter () |
{ |
return CreateDbParameter (); |
} |
protected abstract DbDataReader ExecuteDbDataReader (CommandBehavior behavior); |
public abstract int ExecuteNonQuery (); |
public DbDataReader ExecuteReader () |
{ |
return ExecuteDbDataReader (CommandBehavior.Default); |
} |
public DbDataReader ExecuteReader (CommandBehavior behavior) |
{ |
return ExecuteDbDataReader (behavior); |
} |
public abstract object ExecuteScalar (); |
IDbDataParameter IDbCommand.CreateParameter () |
{ |
return CreateParameter (); |
} |
IDataReader IDbCommand.ExecuteReader () |
{ |
return ExecuteReader (); |
} |
IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior) |
{ |
return ExecuteReader (behavior); |
} |
public abstract void Prepare (); |
public void Dispose() |
{ |
Dispose(true); |
GC.SuppressFinalize(this); |
} |
// <summary> |
// Controls disposal of resources used by this. |
// </summary> |
// |
// <param name="release_all"> Controls which resources are released</param> |
// |
// <remarks> |
// if release_all is set to true, both managed and unmanaged |
// resources should be released. If release_all is set to false, |
// only unmanaged resources should be disposed |
// </remarks> |
protected virtual void Dispose(bool release_all) |
{ |
//if (release_all) |
//{ |
// if (mySite != null && mySite.Container != null) |
// mySite.Container.Remove(this); |
// EventHandler eh = (EventHandler)Events[disposedEvent]; |
// if (eh != null) |
// eh(this, EventArgs.Empty); |
//} |
} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbConnection.cs |
---|
@@ -0,0 +1,789 @@ |
// |
// System.Data.Common.DbConnection |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.ComponentModel; |
using System.Data; |
namespace System.Data.Common { |
public abstract class DbConnection : IDbConnection, IDisposable |
{ |
#region Constructors |
protected DbConnection () |
{ |
} |
#endregion // Constructors |
#region Properties |
[DefaultValue ("")] |
public abstract string ConnectionString { get; set; } |
public abstract string Database { get; } |
public abstract string DataSource { get; } |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public abstract string ServerVersion { get; } |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public abstract ConnectionState State { get; } |
public virtual int ConnectionTimeout { |
get { return 15; } |
} |
#endregion // Properties |
#region Methods |
protected abstract DbTransaction BeginDbTransaction (IsolationLevel isolationLevel); |
public DbTransaction BeginTransaction () |
{ |
return BeginDbTransaction (IsolationLevel.Unspecified); |
} |
public DbTransaction BeginTransaction (IsolationLevel isolationLevel) |
{ |
return BeginDbTransaction (isolationLevel); |
} |
public abstract void ChangeDatabase (string databaseName); |
public abstract void Close (); |
public DbCommand CreateCommand () |
{ |
return CreateDbCommand (); |
} |
protected abstract DbCommand CreateDbCommand (); |
//#if NET_2_0 && !TARGET_JVM |
// public virtual void EnlistTransaction (Transaction transaction) |
// { |
// throw new NotSupportedException (); |
// } |
//#endif |
static class DataTypes |
{ |
static readonly ColumnInfo [] columns = { |
new ColumnInfo ("TypeName", typeof(string)), |
new ColumnInfo ("ProviderDbType", typeof(int)), |
new ColumnInfo ("ColumnSize", typeof(long)), |
new ColumnInfo ("CreateFormat", typeof(string)), |
new ColumnInfo ("CreateParameters", typeof(string)), |
new ColumnInfo ("DataType", typeof(string)), |
new ColumnInfo ("IsAutoIncrementable", typeof(bool)), |
new ColumnInfo ("IsBestMatch", typeof(bool)), |
new ColumnInfo ("IsCaseSensitive", typeof(bool)), |
new ColumnInfo ("IsFixedLength", typeof(bool)), |
new ColumnInfo ("IsFixedPrecisionScale", typeof(bool)), |
new ColumnInfo ("IsLong", typeof(bool)), |
new ColumnInfo ("IsNullable", typeof(bool)), |
new ColumnInfo ("IsSearchable", typeof(bool)), |
new ColumnInfo ("IsSearchableWithLike", typeof(bool)), |
new ColumnInfo ("IsUnsigned", typeof(bool)), |
new ColumnInfo ("MaximumScale", typeof(short)), |
new ColumnInfo ("MinimumScale", typeof(short)), |
new ColumnInfo ("IsConcurrencyType", typeof(bool)), |
new ColumnInfo ("IsLiteralSupported", typeof(bool)), |
new ColumnInfo ("LiteralPrefix", typeof(string)), |
new ColumnInfo ("LiteralSuffix", typeof(string)) |
}; |
static readonly object [][] rows = { |
new object [] {"smallint", 16, 5, "smallint", null, "System.Int16", true, true, |
false, true, true, false, true, true, false, false, null, |
null, false, null, null, null}, |
new object [] {"int", 8, 10, "int", null, "System.Int32", |
true, true, false, true, true, false, true, true, false, |
false, null, null, false, null, null, null}, |
new object [] {"real", 13, 7, "real", null, |
"System.Single", false, true, false, true, false, false, |
true, true, false, false, null, null, false, null, null, null}, |
new object [] {"float", 6, 53, "float({0})", |
"number of bits used to store the mantissa", "System.Double", |
false, true, false, true, false, false, true, true, |
false, false, null, null, false, null, null, null}, |
new object [] {"money", 9, 19, "money", null, |
"System.Decimal", false, false, false, true, true, |
false, true, true, false, false, null, null, false, |
null, null, null}, |
new object [] {"smallmoney", 17, 10, "smallmoney", null, |
"System.Decimal", false, false, false, true, true, false, |
true, true, false, false, null, null, false, null, null, null}, |
new object [] {"bit", 2, 1, "bit", null, "System.Boolean", |
false, false, false, true, false, false, true, true, |
false, null, null, null, false, null, null, null}, |
new object [] {"tinyint", 20, 3, "tinyint", null, |
"System.SByte", true, true, false, true, true, false, |
true, true, false, true, null, null, false, null, null, null}, |
new object [] {"bigint", 0, 19, "bigint", null, |
"System.Int64", true, true, false, true, true, false, |
true, true, false, false, null, null, false, null, null, null}, |
new object [] {"timestamp", 19, 8, "timestamp", null, |
"System.Byte[]", false, false, false, true, false, false, |
false, true, false, null, null, null, true, null, "0x", null}, |
new object [] {"binary", 1, 8000, "binary({0})", "length", |
"System.Byte[]", false, true, false, true, false, false, |
true, true, false, null, null, null, false, null, "0x", null}, |
new object [] {"image", 7, 2147483647, "image", null, |
"System.Byte[]", false, true, false, false, false, true, |
true, false, false, null, null, null, false, null, "0x", null}, |
new object [] {"text", 18, 2147483647, "text", null, |
"System.String", false, true, false, false, false, true, |
true, false, true, null, null, null, false, null, "'", "'"}, |
new object [] {"ntext", 11, 1073741823, "ntext", null, |
"System.String", false, true, false, false, false, true, |
true, false, true, null, null, null, false, null, "N'", "'"}, |
new object [] {"decimal", 5, 38, "decimal({0}, {1})", |
"precision,scale", "System.Decimal", true, true, false, |
true, false, false, true, true, false, false, 38, 0, |
false, null, null, null}, |
new object [] {"numeric", 5, 38, "numeric({0}, {1})", |
"precision,scale", "System.Decimal", true, true, false, |
true, false, false, true, true, false, false, 38, 0, |
false, null, null, null}, |
new object [] {"datetime", 4, 23, "datetime", null, |
"System.DateTime", false, true, false, true, false, false, |
true, true, true, null, null, null, false, null, "{ts '", "'}"}, |
new object [] {"smalldatetime", 15, 16, "smalldatetime", null, |
"System.DateTime", false, true, false, true, false, false, |
true, true, true, null, null, null, false, null, "{ts '", "'}"}, |
new object [] {"sql_variant", 23, null, "sql_variant", |
null, "System.Object", false, true, false, false, false, |
false, true, true, false, null, null, null, false, false, |
null, null}, |
new object [] {"xml", 25, 2147483647, "xml", null, |
"System.String", false, false, false, false, false, true, |
true, false, false, null, null, null, false, false, null, null}, |
new object [] {"varchar", 22, 2147483647, "varchar({0})", |
"max length", "System.String", false, true, false, false, |
false, false, true, true, true, null, null, null, false, |
null, "'", "'"}, |
new object [] {"char", 3, 2147483647, "char({0})", "length", |
"System.String", false, true, false, true, false, false, |
true, true, true, null, null, null, false, null, "'", "'"}, |
new object [] {"nchar", 10, 1073741823, "nchar({0})", "length", |
"System.String", false, true, false, true, false, false, |
true, true, true, null, null, null, false, null, "N'", "'"}, |
new object [] {"nvarchar", 12, 1073741823, "nvarchar({0})", "max length", |
"System.String", false, true, false, false, false, false, true, true, |
true, null, null, null, false, null, "N'", "'"}, |
new object [] {"varbinary", 21, 1073741823, "varbinary({0})", |
"max length", "System.Byte[]", false, true, false, false, |
false, false, true, true, false, null, null, null, false, |
null, "0x", null}, |
new object [] {"uniqueidentifier", 14, 16, "uniqueidentifier", null, |
"System.Guid", false, true, false, true, false, false, true, |
true, false, null, null, null, false, null, "'", "'"} |
}; |
//static DataTable instance; |
//static public DataTable Instance { |
// get { |
// if (instance == null) { |
// instance = new DataTable ("DataTypes"); |
// foreach (ColumnInfo c in columns) |
// instance.Columns.Add (c.name, c.type); |
// foreach (object [] row in rows) |
// instance.LoadDataRow (row, true); |
// } |
// return instance; |
// } |
//} |
} |
struct ColumnInfo { |
public string name; |
public Type type; |
public ColumnInfo (string name, Type type) |
{ |
this.name = name; this.type = type; |
} |
} |
internal static class MetaDataCollections |
{ |
static readonly ColumnInfo [] columns = { |
new ColumnInfo ("CollectionName", typeof (string)), |
new ColumnInfo ("NumberOfRestrictions", typeof (int)), |
new ColumnInfo ("NumberOfIdentifierParts", typeof (int)) |
}; |
static readonly object [][] rows = { |
new object [] {"MetaDataCollections", 0, 0}, |
new object [] {"DataSourceInformation", 0, 0}, |
new object [] {"DataTypes", 0, 0}, |
new object [] {"Restrictions", 0, 0}, |
new object [] {"ReservedWords", 0, 0}, |
new object [] {"Users", 1, 1}, |
new object [] {"Databases", 1, 1}, |
new object [] {"Tables", 4, 3}, |
new object [] {"Columns", 4, 4}, |
new object [] {"Views", 3, 3}, |
new object [] {"ViewColumns", 4, 4}, |
new object [] {"ProcedureParameters", 4, 1}, |
new object [] {"Procedures", 4, 3}, |
new object [] {"ForeignKeys", 4, 3}, |
new object [] {"IndexColumns", 5, 4}, |
new object [] {"Indexes", 4, 3}, |
new object [] {"UserDefinedTypes", 2, 1} |
}; |
//static DataTable instance; |
//static public DataTable Instance { |
// get { |
// if (instance == null) { |
// instance = new DataTable ("GetSchema"); |
// foreach (ColumnInfo c in columns) |
// instance.Columns.Add (c.name, c.type); |
// foreach (object [] row in rows) |
// instance.LoadDataRow (row, true); |
// } |
// return instance; |
// } |
//} |
} |
static class Restrictions |
{ |
static readonly ColumnInfo [] columns = { |
new ColumnInfo ("CollectionName", typeof (string)), |
new ColumnInfo ("RestrictionName", typeof(string)), |
new ColumnInfo ("ParameterName", typeof(string)), |
new ColumnInfo ("RestrictionDefault", typeof(string)), |
new ColumnInfo ("RestrictionNumber", typeof(int)) |
}; |
static readonly object [][] rows = { |
new object [] {"Users", "User_Name", "@Name", "name", 1}, |
new object [] {"Databases", "Name", "@Name", "Name", 1}, |
new object [] {"Tables", "Catalog", "@Catalog", "TABLE_CATALOG", 1}, |
new object [] {"Tables", "Owner", "@Owner", "TABLE_SCHEMA", 2}, |
new object [] {"Tables", "Table", "@Name", "TABLE_NAME", 3}, |
new object [] {"Tables", "TableType", "@TableType", "TABLE_TYPE", 4}, |
new object [] {"Columns", "Catalog", "@Catalog", "TABLE_CATALOG", 1}, |
new object [] {"Columns", "Owner", "@Owner", "TABLE_SCHEMA", 2}, |
new object [] {"Columns", "Table", "@Table", "TABLE_NAME", 3}, |
new object [] {"Columns", "Column", "@Column", "COLUMN_NAME", 4}, |
new object [] {"Views", "Catalog", "@Catalog", "TABLE_CATALOG", 1}, |
new object [] {"Views", "Owner", "@Owner", "TABLE_SCHEMA", 2}, |
new object [] {"Views", "Table", "@Table", "TABLE_NAME", 3}, |
new object [] {"ViewColumns", "Catalog", "@Catalog", "VIEW_CATALOG", 1}, |
new object [] {"ViewColumns", "Owner", "@Owner", "VIEW_SCHEMA", 2}, |
new object [] {"ViewColumns", "Table", "@Table", "VIEW_NAME", 3}, |
new object [] {"ViewColumns", "Column", "@Column", "COLUMN_NAME", 4}, |
new object [] {"ProcedureParameters", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1}, |
new object [] {"ProcedureParameters", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2}, |
new object [] {"ProcedureParameters", "Name", "@Name", "SPECIFIC_NAME", 3}, |
new object [] {"ProcedureParameters", "Parameter", "@Parameter", "PARAMETER_NAME", 4}, |
new object [] {"Procedures", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1}, |
new object [] {"Procedures", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2}, |
new object [] {"Procedures", "Name", "@Name", "SPECIFIC_NAME", 3}, |
new object [] {"Procedures", "Type", "@Type", "ROUTINE_TYPE", 4}, |
new object [] {"IndexColumns", "Catalog", "@Catalog", "db_name(}", 1}, |
new object [] {"IndexColumns", "Owner", "@Owner", "user_name(}", 2}, |
new object [] {"IndexColumns", "Table", "@Table", "o.name", 3}, |
new object [] {"IndexColumns", "ConstraintName", "@ConstraintName", "x.name", 4}, |
new object [] {"IndexColumns", "Column", "@Column", "c.name", 5}, |
new object [] {"Indexes", "Catalog", "@Catalog", "db_name(}", 1}, |
new object [] {"Indexes", "Owner", "@Owner", "user_name(}", 2}, |
new object [] {"Indexes", "Table", "@Table", "o.name", 3}, |
new object [] {"Indexes", "Name", "@Name", "x.name", 4}, |
new object [] {"UserDefinedTypes", "assembly_name", "@AssemblyName", "assemblies.name", 1}, |
new object [] {"UserDefinedTypes", "udt_name", "@UDTName", "types.assembly_class", 2}, |
new object [] {"ForeignKeys", "Catalog", "@Catalog", "CONSTRAINT_CATALOG", 1}, |
new object [] {"ForeignKeys", "Owner", "@Owner", "CONSTRAINT_SCHEMA", 2}, |
new object [] {"ForeignKeys", "Table", "@Table", "TABLE_NAME", 3}, |
new object [] {"ForeignKeys", "Name", "@Name", "CONSTRAINT_NAME", 4} |
}; |
//static DataTable instance; |
//static public DataTable Instance { |
// get { |
// if (instance == null) { |
// instance = new DataTable ("Restrictions"); |
// foreach (ColumnInfo c in columns) |
// instance.Columns.Add (c.name, c.type); |
// foreach (object [] row in rows) |
// instance.LoadDataRow (row, true); |
// } |
// return instance; |
// } |
//} |
} |
static class ReservedWords |
{ |
static readonly string [] reservedWords = |
{ |
"ADD", "EXCEPT", "PERCENT", "ALL", "EXEC", "PLAN", "ALTER", |
"EXECUTE", "PRECISION", "AND", "EXISTS", "PRIMARY", "ANY", |
"EXIT", "PRINT", "AS", "FETCH", "PROC", "ASC", "FILE", |
"PROCEDURE", "AUTHORIZATION", "FILLFACTOR", "PUBLIC", |
"BACKUP", "FOR", "RAISERROR", "BEGIN", "FOREIGN", "READ", |
"BETWEEN", "FREETEXT", "READTEXT", "BREAK", "FREETEXTTABLE", |
"RECONFIGURE", "BROWSE", "FROM", "REFERENCES", "BULK", |
"FULL", "REPLICATION", "BY", "FUNCTION", "RESTORE", |
"CASCADE", "GOTO", "RESTRICT", "CASE", "GRANT", "RETURN", |
"CHECK", "GROUP", "REVOKE", "CHECKPOINT", "HAVING", "RIGHT", |
"CLOSE", "HOLDLOCK", "ROLLBACK", "CLUSTERED", "IDENTITY", |
"ROWCOUNT", "COALESCE", "IDENTITY_INSERT", "ROWGUIDCOL", |
"COLLATE", "IDENTITYCOL", "RULE", "COLUMN", "IF", "SAVE", |
"COMMIT", "IN", "SCHEMA", "COMPUTE", "INDEX", "SELECT", |
"CONSTRAINT", "INNER", "SESSION_USER", "CONTAINS", "INSERT", |
"SET", "CONTAINSTABLE", "INTERSECT", "SETUSER", "CONTINUE", |
"INTO", "SHUTDOWN", "CONVERT", "IS", "SOME", "CREATE", |
"JOIN", "STATISTICS", "CROSS", "KEY", "SYSTEM_USER", |
"CURRENT", "KILL", "TABLE", "CURRENT_DATE", "LEFT", |
"TEXTSIZE", "CURRENT_TIME", "LIKE", "THEN", |
"CURRENT_TIMESTAMP", "LINENO", "TO", "CURRENT_USER", "LOAD", |
"TOP", "CURSOR", "NATIONAL", "TRAN", "DATABASE", "NOCHECK", |
"TRANSACTION", "DBCC", "NONCLUSTERED", "TRIGGER", |
"DEALLOCATE", "NOT", "TRUNCATE", "DECLARE", "NULL", |
"TSEQUAL", "DEFAULT", "NULLIF", "UNION", "DELETE", "OF", |
"UNIQUE", "DENY", "OFF", "UPDATE", "DESC", "OFFSETS", |
"UPDATETEXT", "DISK", "ON", "USE", "DISTINCT", "OPEN", |
"USER", "DISTRIBUTED", "OPENDATASOURCE", "VALUES", "DOUBLE", |
"OPENQUERY", "VARYING", "DROP", "OPENROWSET", "VIEW", |
"DUMMY", "OPENXML", "WAITFOR", "DUMP", "OPTION", "WHEN", |
"ELSE", "OR", "WHERE", "END", "ORDER", "WHILE", "ERRLVL", |
"OUTER", "WITH", "ESCAPE", "OVER", "WRITETEXT", "ABSOLUTE", |
"FOUND", "PRESERVE", "ACTION", "FREE", "PRIOR", "ADMIN", |
"GENERAL", "PRIVILEGES", "AFTER", "GET", "READS", |
"AGGREGATE", "GLOBAL", "REAL", "ALIAS", "GO", "RECURSIVE", |
"ALLOCATE", "GROUPING", "REF", "ARE", "HOST", "REFERENCING", |
"ARRAY", "HOUR", "RELATIVE", "ASSERTION", "IGNORE", "RESULT", |
"AT", "IMMEDIATE", "RETURNS", "BEFORE", "INDICATOR", "ROLE", |
"BINARY", "INITIALIZE", "ROLLUP", "BIT", "INITIALLY", |
"ROUTINE", "BLOB", "INOUT", "ROW", "BOOLEAN", "INPUT", |
"ROWS", "BOTH", "INT", "SAVEPOINT", "BREADTH", "INTEGER", |
"SCROLL", "CALL", "INTERVAL", "SCOPE", "CASCADED", |
"ISOLATION", "SEARCH", "CAST", "ITERATE", "SECOND", |
"CATALOG", "LANGUAGE", "SECTION", "CHAR", "LARGE", |
"SEQUENCE", "CHARACTER", "LAST", "SESSION", "CLASS", |
"LATERAL", "SETS", "CLOB", "LEADING", "SIZE", "COLLATION", |
"LESS", "SMALLINT", "COMPLETION", "LEVEL", "SPACE", |
"CONNECT", "LIMIT", "SPECIFIC", "CONNECTION", "LOCAL", |
"SPECIFICTYPE", "CONSTRAINTS", "LOCALTIME", "SQL", |
"CONSTRUCTOR", "LOCALTIMESTAMP", "SQLEXCEPTION", |
"CORRESPONDING", "LOCATOR", "SQLSTATE", "CUBE", "MAP", |
"SQLWARNING", "CURRENT_PATH", "MATCH", "START", |
"CURRENT_ROLE", "MINUTE", "STATE", "CYCLE", "MODIFIES", |
"STATEMENT", "DATA", "MODIFY", "STATIC", "DATE", "MODULE", |
"STRUCTURE", "DAY", "MONTH", "TEMPORARY", "DEC", "NAMES", |
"TERMINATE", "DECIMAL", "NATURAL", "THAN", "DEFERRABLE", |
"NCHAR", "TIME", "DEFERRED", "NCLOB", "TIMESTAMP", "DEPTH", |
"NEW", "TIMEZONE_HOUR", "DEREF", "NEXT", "TIMEZONE_MINUTE", |
"DESCRIBE", "NO", "TRAILING", "DESCRIPTOR", "NONE", |
"TRANSLATION", "DESTROY", "NUMERIC", "TREAT", "DESTRUCTOR", |
"OBJECT", "TRUE", "DETERMINISTIC", "OLD", "UNDER", |
"DICTIONARY", "ONLY", "UNKNOWN", "DIAGNOSTICS", "OPERATION", |
"UNNEST", "DISCONNECT", "ORDINALITY", "USAGE", "DOMAIN", |
"OUT", "USING", "DYNAMIC", "OUTPUT", "VALUE", "EACH", |
"PAD", "VARCHAR", "END-EXEC", "PARAMETER", "VARIABLE", |
"EQUALS", "PARAMETERS", "WHENEVER", "EVERY", "PARTIAL", |
"WITHOUT", "EXCEPTION", "PATH", "WORK", "EXTERNAL", |
"POSTFIX", "WRITE", "FALSE", "PREFIX", "YEAR", "FIRST", |
"PREORDER", "ZONE", "FLOAT", "PREPARE", "ADA", "AVG", |
"BIT_LENGTH", "CHAR_LENGTH", "CHARACTER_LENGTH", "COUNT", |
"EXTRACT", "FORTRAN", "INCLUDE", "INSENSITIVE", "LOWER", |
"MAX", "MIN", "OCTET_LENGTH", "OVERLAPS", "PASCAL", |
"POSITION", "SQLCA", "SQLCODE", "SQLERROR", "SUBSTRING", |
"SUM", "TRANSLATE", "TRIM", "UPPER" |
}; |
//static DataTable instance; |
//static public DataTable Instance { |
// get { |
// if (instance == null) { |
// DataRow row = null; |
// instance = new DataTable ("ReservedWords"); |
// instance.Columns.Add ("ReservedWord", typeof(string)); |
// foreach (string reservedWord in reservedWords) |
// { |
// row = instance.NewRow(); |
// row["ReservedWord"] = reservedWord; |
// instance.Rows.Add(row); |
// } |
// } |
// return instance; |
// } |
//} |
} |
//public virtual DataTable GetSchema () |
//{ |
// return MetaDataCollections.Instance; |
//} |
//public virtual DataTable GetSchema (string collectionName) |
//{ |
// return GetSchema (collectionName, null); |
//} |
private void AddParameter (DbCommand command, string parameterName, DbType parameterType, int parameterSize) |
{ |
DbParameter parameter = command.CreateParameter (); |
parameter.ParameterName = parameterName; |
parameter.DbType = parameterType; |
parameter.Size = parameterSize; |
command.Parameters.Add (parameter); |
} |
// public virtual DataTable GetSchema (string collectionName, string[] restrictionValues) |
// { |
// if (collectionName == null) |
// //LAMESPEC: In MS.NET, if collectionName is null, it throws ArgumentException. |
// throw new ArgumentException (); |
// String cName = null; |
// DataTable schemaTable = MetaDataCollections.Instance; |
// int length = restrictionValues == null ? 0 : restrictionValues.Length; |
// foreach (DataRow row in schemaTable.Rows) { |
// if (String.Compare ((string) row ["CollectionName"], collectionName, true) == 0) { |
// if (length > (int) row ["NumberOfRestrictions"]) { |
// throw new ArgumentException ("More restrictions were provided " + |
// "than the requested schema ('" + |
// row ["CollectionName"].ToString () + "') supports"); |
// } |
// cName = row ["CollectionName"].ToString (); |
// } |
// } |
// if (cName == null) |
// throw new ArgumentException ("The requested collection ('" + collectionName + "') is not defined."); |
// DbCommand command = null; |
// DataTable dataTable = new DataTable (); |
// switch (cName) |
// { |
// case "Databases": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select name as database_name, dbid, crdate as create_date " + |
// "from master.sys.sysdatabases where (name = @Name or (@Name " + |
// "is null))"; |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// break; |
// case "ForeignKeys": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, " + |
// "TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_TYPE, " + |
// "IS_DEFERRABLE, INITIALLY_DEFERRED from " + |
// "INFORMATION_SCHEMA.TABLE_CONSTRAINTS where (CONSTRAINT_CATALOG" + |
// " = @Catalog or (@Catalog is null)) and (CONSTRAINT_SCHEMA = " + |
// "@Owner or (@Owner is null)) and (TABLE_NAME = @Table or (" + |
// "@Table is null)) and (CONSTRAINT_NAME = @Name or (@Name is null))" + |
// " and CONSTRAINT_TYPE = 'FOREIGN KEY' order by CONSTRAINT_CATALOG," + |
// " CONSTRAINT_SCHEMA, CONSTRAINT_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// break; |
// case "Indexes": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select distinct db_name() as constraint_catalog, " + |
// "constraint_schema = user_name (o.uid), " + |
// "constraint_name = x.name, table_catalog = db_name (), " + |
// "table_schema = user_name (o.uid), table_name = o.name, " + |
// "index_name = x.name from sysobjects o, sysindexes x, " + |
// "sysindexkeys xk where o.type in ('U') and x.id = o.id and " + |
// "o.id = xk.id and x.indid = xk.indid and xk.keyno = x.keycnt " + |
// "and (db_name() = @Catalog or (@Catalog is null)) and " + |
// "(user_name() = @Owner or (@Owner is null)) and (o.name = " + |
// "@Table or (@Table is null)) and (x.name = @Name or (@Name is null))" + |
// "order by table_name, index_name"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// break; |
// case "IndexColumns": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select distinct db_name() as constraint_catalog, " + |
// "constraint_schema = user_name (o.uid), constraint_name = x.name, " + |
// "table_catalog = db_name (), table_schema = user_name (o.uid), " + |
// "table_name = o.name, column_name = c.name, " + |
// "ordinal_position = convert (int, xk.keyno), keyType = c.xtype, " + |
// "index_name = x.name from sysobjects o, sysindexes x, syscolumns c, " + |
// "sysindexkeys xk where o.type in ('U') and x.id = o.id and o.id = c.id " + |
// "and o.id = xk.id and x.indid = xk.indid and c.colid = xk.colid " + |
// "and xk.keyno <= x.keycnt and permissions (o.id, c.name) <> 0 " + |
// "and (db_name() = @Catalog or (@Catalog is null)) and (user_name() " + |
// "= @Owner or (@Owner is null)) and (o.name = @Table or (@Table is" + |
// " null)) and (x.name = @ConstraintName or (@ConstraintName is null)) " + |
// "and (c.name = @Column or (@Column is null)) order by table_name, " + |
// "index_name"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 8); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 13); |
// AddParameter (command, "@ConstraintName", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Column", DbType.StringFixedLength, 4000); |
// break; |
// case "Procedures": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " + |
// "ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE, " + |
// "CREATED, LAST_ALTERED from INFORMATION_SCHEMA.ROUTINES where " + |
// "(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " + |
// "(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME" + |
// " = @Name or (@Name is null)) and (ROUTINE_TYPE = @Type or (@Type " + |
// "is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Type", DbType.StringFixedLength, 4000); |
// break; |
// case "ProcedureParameters": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " + |
// "ORDINAL_POSITION, PARAMETER_MODE, IS_RESULT, AS_LOCATOR, " + |
// "PARAMETER_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, " + |
// "CHARACTER_OCTET_LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, " + |
// "COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " + |
// "CHARACTER_SET_NAME, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, " + |
// "NUMERIC_SCALE, DATETIME_PRECISION, INTERVAL_TYPE, " + |
// "INTERVAL_PRECISION from INFORMATION_SCHEMA.PARAMETERS where " + |
// "(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " + |
// "(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME = " + |
// "@Name or (@Name is null)) and (PARAMETER_NAME = @Parameter or (" + |
// "@Parameter is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA," + |
// " SPECIFIC_NAME, PARAMETER_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Parameter", DbType.StringFixedLength, 4000); |
// break; |
// case "Tables": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE " + |
// "from INFORMATION_SCHEMA.TABLES where" + |
// " (TABLE_CATALOG = @catalog or (@catalog is null)) and " + |
// "(TABLE_SCHEMA = @owner or (@owner is null))and " + |
// "(TABLE_NAME = @name or (@name is null)) and " + |
// "(TABLE_TYPE = @table_type or (@table_type is null))"; |
// AddParameter (command, "@catalog", DbType.StringFixedLength, 8); |
// AddParameter (command, "@owner", DbType.StringFixedLength, 3); |
// AddParameter (command, "@name", DbType.StringFixedLength, 11); |
// AddParameter (command, "@table_type", DbType.StringFixedLength, 10); |
// break; |
// case "Columns": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, " + |
// "ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, " + |
// "CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, " + |
// "NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, " + |
// "DATETIME_PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " + |
// "CHARACTER_SET_NAME, COLLATION_CATALOG from INFORMATION_SCHEMA.COLUMNS" + |
// " where (TABLE_CATALOG = @Catalog or (@Catalog is null)) and (" + |
// "TABLE_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @table" + |
// " or (@Table is null)) and (COLUMN_NAME = @column or (@Column is null" + |
// ")) order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Column", DbType.StringFixedLength, 4000); |
// break; |
// case "Users": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select uid, name as user_name, createdate, updatedate from sysusers" + |
// " where (name = @Name or (@Name is null))"; |
// AddParameter (command, "@Name", DbType.StringFixedLength, 4000); |
// break; |
// case "Views": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CHECK_OPTION, " + |
// "IS_UPDATABLE from INFORMATION_SCHEMA.VIEWS where (TABLE_CATALOG" + |
// " = @Catalog or (@Catalog is null)) TABLE_SCHEMA = @Owner or " + |
// "(@Owner is null)) and (TABLE_NAME = @table or (@Table is null))" + |
// " order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 4000); |
// break; |
// case "ViewColumns": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME, TABLE_CATALOG, " + |
// "TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME from " + |
// "INFORMATION_SCHEMA.VIEW_COLUMN_USAGE where (VIEW_CATALOG = " + |
// "@Catalog (@Catalog is null)) and (VIEW_SCHEMA = @Owner (@Owner" + |
// " is null)) and (VIEW_NAME = @Table or (@Table is null)) and " + |
// "(COLUMN_NAME = @Column or (@Column is null)) order by " + |
// "VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME"; |
// AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Owner", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Table", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@Column", DbType.StringFixedLength, 4000); |
// break; |
// case "UserDefinedTypes": |
// command = CreateCommand (); |
// command.Connection = this; |
// command.CommandText = "select assemblies.name as assembly_name, types.assembly_class " + |
// "as udt_name, ASSEMBLYPROPERTY(assemblies.name, 'VersionMajor') " + |
// "as version_major, ASSEMBLYPROPERTY(assemblies.name, 'VersionMinor') " + |
// "as version_minor, ASSEMBLYPROPERTY(assemblies.name, 'VersionBuild') " + |
// "as version_build, ASSEMBLYPROPERTY(assemblies.name, 'VersionRevision') " + |
// "as version_revision, ASSEMBLYPROPERTY(assemblies.name, 'CultureInfo') " + |
// "as culture_info, ASSEMBLYPROPERTY(assemblies.name, 'PublicKey') " + |
// "as public_key, is_fixed_length, max_length, Create_Date, " + |
// "Permission_set_desc from sys.assemblies as assemblies join " + |
// "sys.assembly_types as types on assemblies.assembly_id = types.assembly_id" + |
// " where (assemblies.name = @AssemblyName or (@AssemblyName is null)) and " + |
// "(types.assembly_class = @UDTName or (@UDTName is null))"; |
// AddParameter (command, "@AssemblyName", DbType.StringFixedLength, 4000); |
// AddParameter (command, "@UDTName", DbType.StringFixedLength, 4000); |
// break; |
// case "MetaDataCollections": |
// return MetaDataCollections.Instance; |
// case "DataSourceInformation": |
// throw new NotImplementedException (); |
// case "DataTypes": |
// return DataTypes.Instance; |
// case "ReservedWords": |
// return ReservedWords.Instance; |
// case "Restrictions": |
// return Restrictions.Instance; |
// } |
// for (int i = 0; i < length; i++) { |
// command.Parameters [i].Value = restrictionValues [i]; |
// } |
// DbDataAdapter dataAdapter = DbProviderFactory.CreateDataAdapter (); |
// dataAdapter.SelectCommand = command; |
// dataAdapter.Fill (dataTable); |
// return dataTable; |
// } |
// protected virtual DbProviderFactory DbProviderFactory { |
//#if MOBILE |
// get {throw new NotImplementedException();} |
//#else |
// get { return DbProviderFactories.GetFactory (this.GetType (). ToString ()); } |
//#endif |
// } |
//#endif |
IDbTransaction IDbConnection.BeginTransaction () |
{ |
return BeginTransaction (); |
} |
IDbTransaction IDbConnection.BeginTransaction (IsolationLevel il) |
{ |
return BeginTransaction (il); |
} |
IDbCommand IDbConnection.CreateCommand () |
{ |
return CreateCommand (); |
} |
public abstract void Open (); |
//protected virtual void OnStateChange (StateChangeEventArgs stateChanged) |
//{ |
// if (StateChange != null) |
// StateChange (this, stateChanged); |
//} |
#endregion // Methods |
//public virtual event StateChangeEventHandler StateChange; |
#region IDisposable Members |
public void Dispose() |
{ |
Dispose(true); |
GC.SuppressFinalize(this); |
} |
// <summary> |
// Controls disposal of resources used by this. |
// </summary> |
// |
// <param name="release_all"> Controls which resources are released</param> |
// |
// <remarks> |
// if release_all is set to true, both managed and unmanaged |
// resources should be released. If release_all is set to false, |
// only unmanaged resources should be disposed |
// </remarks> |
protected virtual void Dispose(bool release_all) |
{ |
//if (release_all) |
//{ |
// if (mySite != null && mySite.Container != null) |
// mySite.Container.Remove(this); |
// EventHandler eh = (EventHandler)Events[disposedEvent]; |
// if (eh != null) |
// eh(this, EventArgs.Empty); |
//} |
} |
#endregion |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbDataReader.cs |
---|
@@ -0,0 +1,191 @@ |
// |
// System.Data.Common.DbDataReader.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.Collections; |
using System.ComponentModel; |
using System.Data; |
namespace System.Data.Common { |
public abstract class DbDataReader : IDataReader, IDataRecord, IDisposable, IEnumerable |
{ |
#region Constructors |
protected DbDataReader () |
{ |
} |
#endregion // Constructors |
#region Properties |
public abstract int Depth { get; } |
public abstract int FieldCount { get; } |
public abstract bool HasRows { get; } |
public abstract bool IsClosed { get; } |
public abstract object this [int index] { get; } |
public abstract object this [string name] { get; } |
public abstract int RecordsAffected { get; } |
public virtual int VisibleFieldCount { |
get { return FieldCount; } |
} |
#endregion // Properties |
#region Methods |
public abstract void Close (); |
public abstract bool GetBoolean (int i); |
public abstract byte GetByte (int i); |
public abstract long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferOffset, int length); |
public abstract char GetChar (int i); |
public abstract long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length); |
[EditorBrowsable (EditorBrowsableState.Never)] |
public void Dispose () |
{ |
Dispose (true); |
} |
protected virtual void Dispose (bool disposing) |
{ |
if (disposing) |
Close (); |
} |
[EditorBrowsable (EditorBrowsableState.Never)] |
public DbDataReader GetData (int i) |
{ |
return ((DbDataReader) this [i]); |
} |
public abstract string GetDataTypeName (int i); |
public abstract DateTime GetDateTime (int i); |
public abstract decimal GetDecimal (int i); |
public abstract double GetDouble (int i); |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract IEnumerator GetEnumerator (); |
public abstract Type GetFieldType (int i); |
public abstract float GetFloat (int i); |
public abstract Guid GetGuid (int i); |
public abstract short GetInt16 (int i); |
public abstract int GetInt32 (int i); |
public abstract long GetInt64 (int i); |
public abstract string GetName (int i); |
public abstract int GetOrdinal (string name); |
[EditorBrowsable (EditorBrowsableState.Never)] |
public virtual Type GetProviderSpecificFieldType (int i) |
{ |
return GetFieldType (i); |
} |
[EditorBrowsable (EditorBrowsableState.Never)] |
public virtual object GetProviderSpecificValue (int i) |
{ |
return GetValue (i); |
} |
[EditorBrowsable (EditorBrowsableState.Never)] |
public virtual int GetProviderSpecificValues (object[] values) |
{ |
return GetValues (values); |
} |
protected virtual DbDataReader GetDbDataReader (int ordinal) |
{ |
return ((DbDataReader) this [ordinal]); |
} |
//public abstract DataTable GetSchemaTable (); |
public abstract string GetString (int i); |
public abstract object GetValue (int i); |
public abstract int GetValues (object[] values); |
IDataReader IDataRecord.GetData (int i) |
{ |
return ((IDataReader) this).GetData (i); |
} |
public abstract bool IsDBNull (int i); |
public abstract bool NextResult (); |
public abstract bool Read (); |
// internal static DataTable GetSchemaTableTemplate () |
//{ |
// Type booleanType = typeof (bool); |
// Type stringType = typeof (string); |
// Type intType = typeof (int); |
// Type typeType = typeof (Type); |
// Type shortType = typeof (short); |
// DataTable schemaTable = new DataTable ("SchemaTable"); |
// schemaTable.Columns.Add ("ColumnName", stringType); |
// schemaTable.Columns.Add ("ColumnOrdinal", intType); |
// schemaTable.Columns.Add ("ColumnSize", intType); |
// schemaTable.Columns.Add ("NumericPrecision", shortType); |
// schemaTable.Columns.Add ("NumericScale", shortType); |
// schemaTable.Columns.Add ("IsUnique", booleanType); |
// schemaTable.Columns.Add ("IsKey", booleanType); |
// schemaTable.Columns.Add ("BaseServerName", stringType); |
// schemaTable.Columns.Add ("BaseCatalogName", stringType); |
// schemaTable.Columns.Add ("BaseColumnName", stringType); |
// schemaTable.Columns.Add ("BaseSchemaName", stringType); |
// schemaTable.Columns.Add ("BaseTableName", stringType); |
// schemaTable.Columns.Add ("DataType", typeType); |
// schemaTable.Columns.Add ("AllowDBNull", booleanType); |
// schemaTable.Columns.Add ("ProviderType", intType); |
// schemaTable.Columns.Add ("IsAliased", booleanType); |
// schemaTable.Columns.Add ("IsExpression", booleanType); |
// schemaTable.Columns.Add ("IsIdentity", booleanType); |
// schemaTable.Columns.Add ("IsAutoIncrement", booleanType); |
// schemaTable.Columns.Add ("IsRowVersion", booleanType); |
// schemaTable.Columns.Add ("IsHidden", booleanType); |
// schemaTable.Columns.Add ("IsLong", booleanType); |
// schemaTable.Columns.Add ("IsReadOnly", booleanType); |
// return schemaTable; |
//} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbDataRecord.cs |
---|
@@ -0,0 +1,267 @@ |
// |
// System.Data.Common.DbDataRecord.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2002-2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.Collections; |
using System.ComponentModel; |
using System.Data; |
using System.Runtime.CompilerServices; |
namespace System.Data.Common |
{ |
public abstract class DbDataRecord : IDataRecord |
{ |
protected DbDataRecord () |
{ |
} |
public abstract int FieldCount { get; } |
public abstract object this [string name] { get; } |
public abstract object this [int i] { get; } |
public abstract bool GetBoolean (int i); |
public abstract byte GetByte (int i); |
public abstract long GetBytes (int i, long dataIndex, byte [] buffer, int bufferIndex,int length); |
public abstract char GetChar (int i); |
public abstract long GetChars (int i, long dataIndex, char [] buffer, int bufferIndex, int length); |
public abstract string GetDataTypeName (int i); |
public abstract DateTime GetDateTime (int i); |
public abstract decimal GetDecimal (int i); |
public abstract double GetDouble (int i); |
public abstract Type GetFieldType (int i); |
public abstract float GetFloat (int i); |
public abstract Guid GetGuid (int i); |
public abstract short GetInt16 (int i); |
public abstract int GetInt32 (int i); |
public abstract long GetInt64 (int i); |
public abstract string GetName (int i); |
public abstract int GetOrdinal (string name); |
public abstract string GetString (int i); |
public abstract object GetValue (int i); |
public abstract int GetValues (object [] values); |
public abstract bool IsDBNull (int i); |
public IDataReader GetData (int i) |
{ |
return (IDataReader) GetValue (i); |
} |
} |
class DbDataRecordImpl : DbDataRecord |
{ |
#region Fields |
readonly SchemaInfo [] schema; |
readonly object [] values; |
readonly int fieldCount; |
#endregion |
#region Constructors |
// FIXME: this class should actually be reimplemented to be one |
// of the derived classes of DbDataRecord, which should become |
// almost abstract. |
internal DbDataRecordImpl (SchemaInfo[] schema, object[] values) |
{ |
this.schema = schema; |
this.values = values; |
this.fieldCount = values.Length; |
} |
#endregion |
#region Properties |
public override int FieldCount { |
get { return fieldCount; } |
} |
public override object this [string name] { |
get { return this [GetOrdinal (name)]; } |
} |
public override object this [int i] { |
get { return GetValue (i); } |
} |
#endregion |
#region Methods |
public override bool GetBoolean (int i) |
{ |
return (bool) GetValue (i); |
} |
public override byte GetByte (int i) |
{ |
return (byte) GetValue (i); |
} |
public override long GetBytes (int i, long dataIndex, byte[] buffer, int bufferIndex, int length) |
{ |
object value = GetValue (i); |
if (!(value is byte [])) |
throw new InvalidCastException ("Type is " + value.GetType ().ToString ()); |
if ( buffer == null ) { |
// Return length of data |
return ((byte []) value).Length; |
} else { |
// Copy data into buffer |
Array.Copy ((byte []) value, (int) dataIndex, buffer, bufferIndex, length); |
return ((byte []) value).Length - dataIndex; |
} |
} |
public override char GetChar (int i) |
{ |
return (char) GetValue (i); |
} |
public override long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length) |
{ |
object value = GetValue (i); |
char [] valueBuffer; |
if (value is char[]) |
valueBuffer = (char []) value; |
else if (value is string) |
valueBuffer = ((string) value).ToCharArray (); |
else |
throw new InvalidCastException ("Type is " + value.GetType ().ToString ()); |
if (buffer == null) { |
// Return length of data |
return valueBuffer.Length; |
} else { |
// Copy data into buffer |
Array.Copy (valueBuffer, (int) dataIndex, buffer, bufferIndex, length); |
return valueBuffer.Length - dataIndex; |
} |
} |
public override string GetDataTypeName (int i) |
{ |
return schema[i].DataTypeName; |
} |
public override DateTime GetDateTime (int i) |
{ |
return (DateTime) GetValue (i); |
} |
public override decimal GetDecimal (int i) |
{ |
return (decimal) GetValue (i); |
} |
public override double GetDouble (int i) |
{ |
return (double) GetValue (i); |
} |
public override Type GetFieldType (int i) |
{ |
return schema[i].FieldType; |
} |
public override float GetFloat (int i) |
{ |
return (float) GetValue (i); |
} |
public override Guid GetGuid (int i) |
{ |
return (Guid) GetValue (i); |
} |
public override short GetInt16 (int i) |
{ |
return (short) GetValue (i); |
} |
public override int GetInt32 (int i) |
{ |
return (int) GetValue (i); |
} |
public override long GetInt64 (int i) |
{ |
return (long) GetValue (i); |
} |
public override string GetName (int i) |
{ |
return schema [i].ColumnName; |
} |
public override int GetOrdinal (string name) |
{ |
for (int i = 0; i < FieldCount; i++) |
if (schema [i].ColumnName == name) |
return i; |
return -1; |
} |
public override string GetString (int i) |
{ |
return (string) GetValue (i); |
} |
public override object GetValue (int i) |
{ |
if (i < 0 || i > fieldCount) |
throw new IndexOutOfRangeException (); |
return values [i]; |
} |
public override int GetValues (object[] values) |
{ |
if (values == null) |
throw new ArgumentNullException("values"); |
int count = values.Length > this.values.Length ? this.values.Length : values.Length; |
for(int i = 0; i < count; i++) |
values [i] = this.values [i]; |
return count; |
} |
public override bool IsDBNull (int i) |
{ |
return GetValue (i) == DBNull.Value; |
} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbEnumerator.cs |
---|
@@ -0,0 +1,116 @@ |
// |
// System.Data.SqlClient.DbEnumerator.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2002 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
using System.Collections; |
using System.ComponentModel; |
using System.Data; |
namespace System.Data.Common { |
public class DbEnumerator : IEnumerator |
{ |
#region Fields |
readonly IDataReader reader; |
readonly bool closeReader; |
readonly SchemaInfo [] schema; |
readonly object [] values; |
#endregion // Fields |
#region Constructors |
public DbEnumerator (IDataReader reader) |
: this (reader, false) |
{ |
} |
public DbEnumerator (IDataReader reader, bool closeReader) |
{ |
this.reader = reader; |
this.closeReader = closeReader; |
this.values = new object [reader.FieldCount]; |
this.schema = LoadSchema (reader); |
} |
#endregion // Constructors |
#region Properties |
public object Current { |
get { |
reader.GetValues (values); |
return new DbDataRecordImpl (schema, values); |
} |
} |
#endregion // Properties |
#region Methods |
private static SchemaInfo[] LoadSchema (IDataReader reader) |
{ |
int fieldCount = reader.FieldCount; |
SchemaInfo[] schema = new SchemaInfo [fieldCount]; |
for(int i=0; i < fieldCount; i++) { |
SchemaInfo columnSchema = new SchemaInfo (); |
columnSchema.ColumnName = reader.GetName(i); |
columnSchema.ColumnOrdinal = i; |
columnSchema.DataTypeName = reader.GetDataTypeName (i); |
columnSchema.FieldType = reader.GetFieldType (i); |
schema [i] = columnSchema; |
} |
return schema; |
} |
public bool MoveNext () |
{ |
if (reader.Read ()) |
return true; |
if (closeReader) |
reader.Close (); |
return false; |
} |
[EditorBrowsable (EditorBrowsableState.Never)] |
public void Reset () |
{ |
throw new NotSupportedException (); |
} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbException.cs |
---|
@@ -0,0 +1,59 @@ |
// |
// System.Data.Common.DbException.cs |
// |
// Author: Umadevi S (sumadevi@novell.com) |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
using System.Globalization; |
using System.Runtime.Serialization; |
using System.Runtime.InteropServices; |
namespace System.Data.Common { |
#if NETFX_CORE |
public abstract class DbException : Exception |
#else |
public abstract class DbException : ExternalException |
#endif |
{ |
protected DbException () |
{ |
} |
protected DbException (string message) : base(message) |
{ |
} |
protected DbException (string message, Exception innerException) |
: base (message, innerException) |
{ |
} |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbParameter.cs |
---|
@@ -0,0 +1,114 @@ |
// |
// System.Data.Common.DbParameter.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.Collections.Generic ; |
using System.ComponentModel; |
namespace System.Data.Common { |
public abstract class DbParameter : IDbDataParameter, IDataParameter |
{ |
#region Constructors |
internal static Dictionary<DbType, Type> dbTypeMapping; |
protected DbParameter () |
{ |
} |
#endregion // Constructors |
#region Properties |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public abstract DbType DbType { get; set; } |
[DefaultValue (ParameterDirection.Input)] |
public abstract ParameterDirection Direction { get; set; } |
[DefaultValue ("")] |
public abstract string ParameterName { get; set; } |
public abstract int Size { get; set; } |
byte IDbDataParameter.Precision { |
get { return 0; } |
set {} |
} |
byte IDbDataParameter.Scale { |
get { return 0; } |
set {} |
} |
[DefaultValue (null)] |
public abstract object Value { get; set; } |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract bool IsNullable { get; set; } |
[DefaultValue ("")] |
public abstract string SourceColumn { get; set; } |
[DefaultValue (false)] |
[EditorBrowsable (EditorBrowsableState.Advanced)] |
public abstract bool SourceColumnNullMapping { get; set; } |
//[DefaultValue (DataRowVersion.Current)] |
//public abstract DataRowVersion SourceVersion { get; set; } |
#endregion // Properties |
#region Methods |
[EditorBrowsable (EditorBrowsableState.Advanced)] |
public abstract void ResetDbType (); |
internal virtual object FrameworkDbType { |
get {return null;} |
set {} |
} |
internal protected static Dictionary<DbType, Type> DbTypeMapping |
{ |
get { return dbTypeMapping;} |
set { dbTypeMapping = value;} |
} |
// LAMESPEC: Implementors should populate the dbTypeMapping accordingly |
internal virtual Type SystemType { |
get { |
return (Type) dbTypeMapping [DbType]; |
} |
} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbParameterCollection.cs |
---|
@@ -0,0 +1,146 @@ |
// |
// System.Data.Common.DbParameterCollection.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System.Collections; |
using System.ComponentModel; |
using System.Runtime.InteropServices; |
namespace System.Data.Common { |
public abstract class DbParameterCollection : IDataParameterCollection, IList, ICollection, IEnumerable |
{ |
#region Constructors |
protected DbParameterCollection () |
{ |
} |
#endregion // Constructors |
#region Properties |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
public abstract int Count { |
get; |
} |
object IDataParameterCollection.this [string parameterName] { |
get { return this [parameterName]; } |
set { this [parameterName] = (DbParameter) value; } |
} |
object IList.this [int index] { |
get { return this [index]; } |
set { this [index] = (DbParameter) value; } |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract bool IsFixedSize { |
get; |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract bool IsReadOnly { |
get; |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract bool IsSynchronized { |
get; |
} |
public DbParameter this [string parameterName] { |
get { |
int index = IndexOf (parameterName); |
return this [index]; |
} |
set { |
int index = IndexOf (parameterName); |
this [index] = value; |
} |
} |
public DbParameter this [int index] { |
get { return GetParameter (index); } |
set { SetParameter (index, value); } |
} |
#if !(WINDOWS_PHONE || NETFX_CORE) |
[Browsable (false)] |
#endif |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract object SyncRoot { |
get; |
} |
#endregion // Properties |
#region Methods |
public abstract int Add (object value); |
public abstract void AddRange (Array values); |
protected abstract DbParameter GetParameter (String parameterName); |
protected abstract void SetParameter (String parameterName, |
DbParameter value); |
public abstract void Clear (); |
public abstract bool Contains (object value); |
public abstract bool Contains (string value); |
public abstract void CopyTo (Array array, int index); |
[EditorBrowsable (EditorBrowsableState.Never)] |
public abstract IEnumerator GetEnumerator (); |
protected abstract DbParameter GetParameter (int index); |
public abstract int IndexOf (object value); |
public abstract int IndexOf (string parameterName); |
public abstract void Insert (int index, object value); |
public abstract void Remove (object value); |
public abstract void RemoveAt (int index); |
public abstract void RemoveAt (string parameterName); |
protected abstract void SetParameter (int index, DbParameter value); |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbTransaction.cs |
---|
@@ -0,0 +1,84 @@ |
// System.Data.Common.DbTransaction.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2003 |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
namespace System.Data.Common |
{ |
public abstract class DbTransaction : IDbTransaction, IDisposable |
{ |
#region Constructors |
protected DbTransaction () |
{ |
} |
#endregion // Constructors |
#region Properties |
public DbConnection Connection { |
get { return DbConnection; } |
} |
protected abstract DbConnection DbConnection { |
get; |
} |
IDbConnection IDbTransaction.Connection { |
get { return (IDbConnection) Connection; } |
} |
public abstract IsolationLevel IsolationLevel { |
get; |
} |
#endregion // Properties |
#region Methods |
public abstract void Commit (); |
public abstract void Rollback (); |
public void Dispose () |
{ |
Dispose (true); |
} |
protected virtual void Dispose (bool disposing) |
{ |
} |
#endregion // Methods |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/DbTypes.cs |
---|
@@ -0,0 +1,35 @@ |
using System; |
namespace System.Data.Common |
{ |
internal class DbTypes |
{ |
#region .Net types constants |
internal static readonly Type TypeOfBoolean = typeof(Boolean); |
internal static readonly Type TypeOfSByte = typeof(SByte); |
internal static readonly Type TypeOfChar = typeof(Char); |
internal static readonly Type TypeOfInt16 = typeof(Int16); |
internal static readonly Type TypeOfInt32 = typeof(Int32); |
internal static readonly Type TypeOfInt64 = typeof(Int64); |
internal static readonly Type TypeOfByte = typeof(Byte); |
internal static readonly Type TypeOfUInt16 = typeof(UInt16); |
internal static readonly Type TypeOfUInt32 = typeof(UInt32); |
internal static readonly Type TypeOfUInt64 = typeof(UInt64); |
internal static readonly Type TypeOfDouble = typeof(Double); |
internal static readonly Type TypeOfSingle = typeof(Single); |
internal static readonly Type TypeOfDecimal = typeof(Decimal); |
internal static readonly Type TypeOfString = typeof(String); |
internal static readonly Type TypeOfDateTime = typeof(DateTime); |
internal static readonly Type TypeOfObject = typeof(object); |
internal static readonly Type TypeOfGuid = typeof(Guid); |
internal static readonly Type TypeOfType = typeof(Type); |
// additional types |
internal static readonly Type TypeOfByteArray = typeof(Byte[]); |
internal static readonly Type TypeOfFloat = typeof (float); |
internal static readonly Type TypeOfTimespan = typeof (TimeSpan); |
#endregion // .Net types constants |
} |
} |
/trunk/System.Data.Ersatz/src/System.Data.Common/SchemaInfo.cs |
---|
@@ -0,0 +1,116 @@ |
// |
// System.Data.Common.SchemaInfo.cs |
// |
// Author: |
// Tim Coleman (tim@timcoleman.com) |
// |
// Copyright (C) Tim Coleman, 2002 |
// |
// |
// Copyright (C) 2004 Novell, Inc (http://www.novell.com) |
// |
// Permission is hereby granted, free of charge, to any person obtaining |
// a copy of this software and associated documentation files (the |
// "Software"), to deal in the Software without restriction, including |
// without limitation the rights to use, copy, modify, merge, publish, |
// distribute, sublicense, and/or sell copies of the Software, and to |
// permit persons to whom the Software is furnished to do so, subject to |
// the following conditions: |
// |
// The above copyright notice and this permission notice shall be |
// included in all copies or substantial portions of the Software. |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// |
using System; |
namespace System.Data.Common { |
internal class SchemaInfo |
{ |
#region Fields |
string columnName; |
string tableName; |
string dataTypeName; |
bool allowDBNull; |
bool isReadOnly; |
int ordinal; |
int size; |
byte precision; |
byte scale; |
Type fieldType; |
#endregion // Fields |
#region Constructors |
public SchemaInfo () |
{ |
} |
#endregion // Constructors |
#region Properties |
public bool AllowDBNull { |
get { return allowDBNull; } |
set { allowDBNull = value; } |
} |
public string ColumnName { |
get { return columnName; } |
set { columnName = value; } |
} |
public int ColumnOrdinal { |
get { return ordinal; } |
set { ordinal = value; } |
} |
public int ColumnSize { |
get { return size; } |
set { size = value; } |
} |
public String DataTypeName { |
get { return dataTypeName; } |
set { dataTypeName = value; } |
} |
public Type FieldType { |
get { return fieldType; } |
set { fieldType = value; } |
} |
public byte NumericPrecision { |
get { return precision; } |
set { precision = value; } |
} |
public byte NumericScale { |
get { return scale; } |
set { scale = value; } |
} |
public string TableName { |
get { return tableName; } |
set { tableName = value; } |
} |
public bool IsReadOnly { |
get { return isReadOnly; } |
set { isReadOnly = value; } |
} |
#endregion // Properties |
} |
} |