`

微软企业库 数据访问模块2

 
阅读更多

       数据库访问模块都能实现哪些功能呢?数据库访问模块抽象类你正在使用的数据库,提供了一些列接口,使得你可以更容易的实现常用的数据库访问功能。例如:使用Database类填充DataSet数据集,用database类获取一个适当的Command实例,然后调用database的ExecuteDataSet方法,就可以填充数据集。不需要你调用DataAdapter的Fill方法。ExecuteDataSet方法管理数据库连接,实现了填充数据集所需要的所有工作。使用类似的方法,通过database类可以直接执行command,可以获取一个DataReader实例,可以用dataset中的数据更新数据库。模块也支持多个操作的事务,如果失败的话,可以回滚。

  除了使用ADO.NET也能完成的常用功能以外,模块还支持异步访问数据库(只要数据支持)。还可以返回客户端可以用LINQ查询的数据的序列对象形式。

  使用数据访问模块的主要优点,除了简化开发以外,它使得你可以创建一种provider独立的应用,可以很容易的更换不同的数据提供源。在大多数情况下,除非你在代码中指定了数据库类型,剩下的就是更改配置文件中的连接字符串配置节就可以了。不需要你修改代码中的sql查询和存储过程及其参数。

  数据访问模块提供的常用方法

  下面列出一些模块常用的获取数据、更新数据方法,其中有一些和直接使用ADO.NET中的方法很相似。

  

 

 

方法

功能

ExecuteDataset,创建,加载,返回数据集

LoadData,加载数据到一个已经存在的数据集

UpdateDataSet,使用已经存在的数据集更新数据库内容

填充一个数据集,使用数据集更新数据库

ExecuteReader,创建,返回一个provider独立的DbDataReader实例

从数据库读取多行数据

ExecuteNonQuery,执行command,返回数据库受影响的行数,可以通过output返回多个值

ExecuteScalar,执行command,返回单个值

执行command数据库命令对象

ExecuteSproAccessor,使用存储过程返回一个客户端可以查询的序列对象

ExecuteSqlStringAccessor,使用SQL语句返回一个客户端可以查询的序列对象

以序列对象的形式返回数据

ExecuteXmlReader,返回xml格式的数据,xmlReader类型,这个只能用在SQL Server数据库,通过SqlDatabase类调用,Database类中没有这个方法。

获取xml格式数据(只能用在SQL Server数据库)

GetStoredProcCommand,返回一个存储过程的数据库command对象

GetSqlStringCommand,返回一个SQL语句的数据库command对象

创建一个Command对象

AddInParameter,创建一个新的input参数,并且加入command的参数集合

AddOutParameter,创建一个新的output参数,并且加入command的参数集合

AddParameter,创建一个指定类型的参数,并且加入command的参数集合

GetParameterValue,以Object类型返回指定参数的值

SetParameterValue,给指定参数赋值

 

处理command的参数

CreateConnection,创建,返回当前数据库的连接,允许你通过这个链接初始化和管理数据库事务

处理数据库事务

 

 

      如果你使用SqlDatabase类的话,可以使用Begin和End类型的方法实现数据库异步操作。

      如何使用数据库访问模块

      1首先通过企业库的配置工具添加模块配置

      2在代码中添加如下代码

     

 

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->static Database defaultDB = null;
static Database namedDB = null;
// 从容器中获取默认的数据库对象
// The actual concrete type is determined by the configuration settings.
defaultDB = EnterpriseLibraryContainer.Current.GetInstance<Database>();
// 从容器中获取指定名称的数据库对象
namedDB
= EnterpriseLibraryContainer.Current.GetInstance<Database>("ExampleDatabase");

 

       如果你需要使用ExecuteXmlReader方法,或者是需要使用SQL Server数据库对象的话,可以用下面的代码。

 

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->static SqlDatabase sqlServerDB = null;
// Resolve a SqlDatabase object from the container using the default database.
sqlServerDB = EnterpriseLibraryContainer.Current.GetInstance<Database>()
as SqlDatabase;

// Assume the method GetConnectionString exists in your application and
// returns a valid connection string.
string myConnectionString = GetConnectionString();
SqlDatabase sqlDatabase = new SqlDatabase(myConnectionString);

 

      使用DataReader获取多行数据

 

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->// Call the ExecuteReader method by specifying just the stored procedure name.
using (IDataReader reader = namedDB.ExecuteReader("MyStoredProcName"))
{
// Use the values in the rows as required.
}

// Call the ExecuteReader method by specifying the command type
// as a SQL statement, and passing in the SQL statement.
using (IDataReader reader = namedDB.ExecuteReader(CommandType.Text,
"SELECT TOP 1 * FROM OrderList"))
{
// Use the values in the rows as required ‐ here we are just displaying them.
DisplayRowValues(reader);
}

 

      根据参数获取多行数据

     

 

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->using (IDataReader reader = defaultDB.ExecuteReader("ListOrdersByState",
new object[] { "Colorado" }))
{
// Use the values in the rows as required ‐ here we are just displaying them.
DisplayRowValues(reader);
}

 

     

     

      通过添加参数获取多行数据

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->// Read data with a SQL statement that accepts one parameter.
string sqlStatement = "SELECT TOP 1 * FROM OrderList WHERE State LIKE @state";
// Create a suitable command type and add the required parameter.
using (DbCommand sqlCmd = defaultDB.GetSqlStringCommand(sqlStatement))
{
defaultDB.AddInParameter(sqlCmd, "state", DbType.String, "New York");
// Call the ExecuteReader method with the command.
using (IDataReader sqlReader = namedDB.ExecuteReader(sqlCmd))
{
Console.WriteLine("Results from executing SQL statement:");
DisplayRowValues(sqlReader);
}
}

 

     

 

 

 

代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->// Create a suitable command type and add the required parameter.
using (DbCommand sprocCmd = defaultDB.GetStoredProcCommand(storedProcName))
{
defaultDB.AddInParameter(sprocCmd, "state", DbType.String, "New York");
// Call the ExecuteReader method with the command.
using (IDataReader sprocReader = namedDB.ExecuteReader(sprocCmd))
{
Console.WriteLine("Results from executing stored procedure:");
DisplayRowValues(sprocReader);
}
}

 

      以对象形式返回数据

     

      上图是一个使用Accessor访问数据库,返回对象形式的数据的过程。

 

转自:http://www.cnblogs.com/virusswb/archive/2010/05/14/Enterprise-Library-DataAccessBlock-3.html

 

 

以对象形式从数据库获取数据

  现代的很多编程技术都集中在“数据就是对象”这个概念。如果你在应用层之间使用Data Transfer Objects (DTOs)传输数据的话,这个方法就很有用,使用ORM实现一个数据访问层,或者是客户端查询技术,例如LINQ。

  数据库访问模块实现了这个功能,允许你执行SQL或者是存储过程,可以返回一个对象序列,但是要求序列实现IEnumerable接口。

  关于Accessors

  模块提供了两个方法来实现这种查询要求,SprocAccessor和SqlStringAccessor。你可以使用Database类的ExecuteSprocAccessor和ExecuteSqlStringAccessor,或者是创建一个Accessor,然后调用它的Execute方法。

  下面是一张查询示意图

  

  Accessor使用另外两个对象,一个用来管理传入accessor的参数,一个用来将数据库返回的数据行映射成客户端需要的对象。

  如果你没有指定一个参数映射,accessor会使用默认的参数映射。默认情况下这个功能只能用于执行SQL Server和Oracle的存储过程。不能执行SQL 语句,或者是其他的数据库和provider,如果需要的话,可以自定义参数映射器。

  如果你没有指定一个对象映射,模块使用默认的对象映射,根据列的名称映射到对象的属性。你也可以自定义对象映射,将列映射到指定的对象属性上去。

  创建和执行Accessor

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->// Create an object array and populate it with the required parameter values
object[] params = new object[] { "%bike%" };
// Create and execute a sproc accessor that uses the default
// parameter and output mappings.
var productData = defaultDB.ExecuteSprocAccessor<Product>("GetProductList",
params);
// Perform a client‐side query on the returned data. Be aware that
// the orderby and filtering is happening on the client, not in the database.
var results = from productItem in productData
where productItem.Description != null
orderby productItem.Name
select new { productItem.Name, productItem.Description };
// Display the results
foreach (var item in results)
{
A Guide to Developing with Enterprise Library 5.0 41
Console.WriteLine("Product Name: {0}", item.Name);
Console.WriteLine("Description: {0}", item.Description);
Console.WriteLine();
}
复制代码

 

 

  上面假设由一个Product类,有ID,Name,Description三个属性。

  创建和使用映射Mappers

  在某些情况下,你需要自定义参数映射,将你的参数传递给要执行查询的accessor。这种典型的情况发生在,你需要执行一个SQL语句,和一个不支持参数的数据库进行交互,或者是默认的参数映射的参数个数或者是类型不匹配。参数映射类需要实现IParameterMapper接口,有一个AssignParameters方法引用了Command对象作为参数,你需要做的就是将需要的参数加入Command对象的Parameters集合。

  在更多的情况你需要一个自定义对象映射。为了帮助你完成这个需求,模块提供了MapBuilder类,用它可以创建列和对象属性的映射关系。

  默认情况,accessor可以返回一个简单的对象序列。但是,有时候需要返回一个复杂的对象序列,例如,返回Orders的同时返回相关的OrderLines。简单的映射不能满足这样的需求,MapBuilder类也不能满足了。你需要实现IResultSetMapper接口,自定义对象映射关系。

  获取XML数据

  企业库提供了ExecuteXmlReader方法返回一个XmlReader对象。目前为止,还只能支持SQL Server数据库,意味着你只能用SqlDatabase类。

  你需要把Database转换成SqlDatabse,或者是用构造函数直接创建一个SqlDatabse。

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->static SqlDatabase sqlServerDB = null;
// Resolve a SqlDatabase object from the container using the default database.
sqlServerDB
= EnterpriseLibraryContainer.Current.GetInstance<Database>() as SqlDatabase;
// Specify a SQL query that returns XML data
string xmlQuery = "SELECT * FROM OrderList WHERE State = @state FOR XML AUTO";
// Create a suitable command type and add the required parameter
// NB: ExecuteXmlReader is only available for SQL Server databases
using (DbCommand xmlCmd = sqlServerDB.GetSqlStringCommand(xmlQuery))
{
xmlCmd.Parameters.Add(new SqlParameter("state""Colorado"));
using (XmlReader reader = sqlServerDB.ExecuteXmlReader(xmlCmd))
{
while (!reader.EOF) // Iterate through the elements in the XmlReader
{
if (reader.IsStartElement())
{
Console.WriteLine(reader.ReadOuterXml());
}
}
}
}
复制代码

 

 

  获取单个值

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->// Create a suitable command type for a SQL statement
// NB: For efficiency, aim to return only a single value or a single row.
using (DbCommand sqlCmd
= defaultDB.GetSqlStringCommand("SELECT [Name] FROM States"))
{
// Call the ExecuteScalar method of the command
Console.WriteLine("Result using a SQL statement: {0}",
defaultDB.ExecuteScalar(sqlCmd).ToString());
}
// Create a suitable command type for a stored procedure
// NB: For efficiency, aim to return only a single value or a single row.
using (DbCommand sprocCmd = defaultDB.GetStoredProcCommand("GetStatesList"))
{
// Call the ExecuteScalar method of the command
Console.WriteLine("Result using a stored procedure: {0}",
defaultDB.ExecuteScalar(sprocCmd).ToString());
}
复制代码

 

  异步获取数据

  1)准备配置文件

  需要在连接字符串中添加Asynchronous Processing=true或者是async=true。

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />--><connectionStrings>
<add name="AsyncExampleDatabase"
connectionString="Asynchronous Processing=true; Data Source=.\SQLEXPRESS;
Initial Catalog="MyDatabase"; Integrated Security=True;"
providerName="System.Data.SqlClient" />
...
</connectionStrings>
复制代码

 

  另外,企业库中的异步访问数据库只支持SQL Server。在Database类由一个属性SupportsAsync,可以用来查询当前数据库是否支持异步访问。

  

 

 

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->private static bool SupportsAsync(Database db)
{
if (db.SupportsAsync)
{
Console.WriteLine("Database supports asynchronous operations");
return true;
}
Console.WriteLine("Database does not support asynchronous operations");
return false;
}
复制代码

 

  使用异步访问数据库通常需要一个callback,在调用端会打开另外一个线程。这个callback通常不会直接访问winform和wpf的用户界面。你需要在用户界面添加事件,然后通过委托的方式更新用户界面。

  委托可以使用Lambda表达式实现。

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->DbCommand cmd = asyncDB.GetStoredProcCommand("ListOrdersSlowly");
asyncDB.AddInParameter(cmd, "state", DbType.String, "Colorado");
asyncDB.AddInParameter(cmd, "status", DbType.String, "DRAFT");
// Execute the query asynchronously specifying the command and the
// expression to execute when the data access process completes.
asyncDB.BeginExecuteReader(cmd,
asyncResult =>
{
// Lambda expression executed when the data access completes.
try
{
using (IDataReader reader = asyncDB.EndExecuteReader(asyncResult))
{
A Guide to Developing with Enterprise Library 5.0 47
Console.WriteLine();
DisplayRowValues(reader);
}
}
catch (Exception ex)
{
Console.WriteLine("Error after data access completed: {0}", ex.Message);
}
}, null);
复制代码

  

 

  异步获取对象形式返回的数据

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->object[] paramArray = new object[] { "%bike%"20 };
// Create the accessor. This example uses the simplest overload.
var accessor = asyncDB.CreateSprocAccessor<Product>("GetProductsSlowly");
// Execute the accessor asynchronously specifying the callback expression,
// the existing accessor as the AsyncState, and the parameter values array.
accessor.BeginExecute(
asyncResult =>
// Lambda expression executed when the data access completes.
try
{
// Accessor is available via the asyncResult parameter
var acc = (IDataAccessor<Product>) asyncResult.AsyncState;
// Obtain the results from the accessor.
var productData = acc.EndExecute(asyncResult);
// Perform a client‐side query on the returned data.
// Be aware that the orderby and filtering is happening
// on the client, not inside the database.
var results = from productItem in productData
where productItem.Description != null
orderby productItem.Name
select new { productItem.Name, productItem.Description };
// Display the results
Console.WriteLine();
foreach (var item in results)
{
Console.WriteLine("Product Name: {0}", item.Name);
Console.WriteLine("Description: {0}", item.Description);
Console.WriteLine();
}
}
catch (Exception ex)
{
Console.WriteLine("Error after data access completed: {0}", ex.Message);
}
}, accessor, paramArray);
复制代码

 

  更新数据库

  

 

复制代码
代码
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />-->string oldDescription
= "Carries 4 bikes securely; steel construction, fits 2\" receiver hitch.";
string newDescription = "Bikes tend to fall off after a few miles.";
// Create command to execute the stored procedure and add the parameters.
DbCommand cmd = defaultDB.GetStoredProcCommand("UpdateProductsTable");
defaultDB.AddInParameter(cmd, "productID", DbType.Int32, 84);
defaultDB.AddInParameter(cmd, "description", DbType.String, newDescription);
// Execute the query and check if one row was updated.
if (defaultDB.ExecuteNonQuery(cmd) == 1)
{
// Update succeeded.
}

else
{
Console.WriteLine("ERROR: Could not update just one row.");
}
// Change the value of the second parameter
defaultDB.SetParameterValue(cmd, "description", oldDescription);
// Execute query and check if one row was updated
if (defaultDB.ExecuteNonQuery(cmd) == 1)
{
// Update succeeded.
}
else
{
Console.WriteLine("ERROR: Could not update just one row.");
}
复制代码
 
 
       使用DataSet进行工作

  使用Database类的ExecuteDataSet方法获取DataSet对象,在DataSet对象中,默认的表名称依次为Table,Table1,Table2.。。。。。。。。。。。。

  如果你想要将数据加载到一个已经存在的DataSet对象中,可以使用LoadDataSet方法。

  

复制代码
代码
<!--<br/ /> <br/ /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ /> http://www.CodeHighlighter.com/<br/ /> <br/ /> -->DataSet productDataSet;
// Using a SQL statement and a parameter array.
productDataSet = db.ExecuteDataSet(CommandType.Text, "GetProductsByCategory",
new Object[] { "%bike%" });
// Using a stored procedure and a parameter array.
productDataSet = db.ExecuteDataSet("GetProductsByCategory",
new Object[] { "%bike%" });
// Using a stored procedure and a named parameter.
DbCommand cmd = db.GetStoredProcCommand("GetProductsByCategory");
db.AddInParameter(cmd, "CategoryID", DbType.Int32, 7);
productDataSet = db.ExecuteDataSet(cmd);
复制代码
  

 

  将DataSet中的数据更新回数据库

  如果要更新数据库,可以使用Database的UpdateDataSet方法,返回受影响的行数总和。

  有一个参数是UpdateBehavior,决定了更新目标数据库表的方式。包括下面的几个值:

  Standard:如果更新失败,停止更新。

  Continue:如果更新失败,将继续其他的更新。

  Transactional:如果更新失败,所有的操作都将回滚。

  另外你还可以为UpdateDataSet方法的UpdateBatchSize参数提供一个值,设置更新方式为批量更新而不是一个一个的发送到数据库。这么做更高效,但是返回值就是最后一次批量发送的影响行数了,而不是所有的更新总数。

  加载数据到一个已经存在的DataSet  

 

复制代码
代码
<!--<br/ /> <br/ /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ /> http://www.CodeHighlighter.com/<br/ /> <br/ /> -->string selectSQL = "SELECT Id, Name, Description FROM Products WHERE Id > 90";
// Fill a DataSet from the Products table using the simple approach
DataSet simpleDS = defaultDB.ExecuteDataSet(CommandType.Text, selectSQL);
DisplayTableNames(simpleDS, "ExecuteDataSet");
// Fill a DataSet from the Products table using the LoadDataSet method
// This allows you to specify the name(s) for the table(s) in the DataSet
DataSet loadedDS = new DataSet("ProductsDataSet");
defaultDB.LoadDataSet(CommandType.Text, selectSQL, loadedDS,
new string[] { "Products" });
DisplayTableNames(loadedDS, "LoadDataSet");
复制代码

 

  更新数据库UpdateDataSet

 

复制代码
代码
<!--<br/ /> <br/ /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ /> http://www.CodeHighlighter.com/<br/ /> <br/ /> -->string addSQL = "INSERT INTO Products (Name, Description) VALUES (@name,
@description);";
string updateSQL = "UPDATE Products SET Name = @name, Description = @description
WHERE Id = @id";
string deleteSQL = "DELETE FROM Products WHERE Id = @id";
// Create the commands to update the original table in the database
DbCommand insertCommand = defaultDB.GetSqlStringCommand(addSQL);
defaultDB.AddInParameter(insertCommand, "name", DbType.String, "Name",
DataRowVersion.Current);
defaultDB.AddInParameter(insertCommand, "description", DbType.String,
"Description", DataRowVersion.Current);
DbCommand updateCommand = defaultDB.GetSqlStringCommand(updateSQL);
defaultDB.AddInParameter(updateCommand, "name", DbType.String, "Name",
DataRowVersion.Current);
defaultDB.AddInParameter(updateCommand, "description", DbType.String,
"Description", DataRowVersion.Current);
defaultDB.AddInParameter(updateCommand, "id", DbType.String, "Id",
DataRowVersion.Original);
DbCommand deleteCommand = defaultDB.GetSqlStringCommand(deleteSQL);
defaultDB.AddInParameter(deleteCommand, "id", DbType.Int32, "Id",
DataRowVersion.Original);
Finally, you can apply the changes by calling the UpdateDataSet method, as shown here.
// Apply the updates in the DataSet to the original table in the database
int rowsAffected = defaultDB.UpdateDataSet(loadedDS, "Products",
insertCommand, updateCommand, deleteCommand,
UpdateBehavior.Standard);
Console.WriteLine("Updated a total of {0} rows in the database.", rowsAffected);
复制代码

 

 

 

  以数据库连接为基础的事务操作

  就是操作一个数据库,以一个数据库连接为基础。

  一个常用的数据库解决方案,都会包括一些事务的处理,例如银行的转账。

  事务要满足ACID原则:

  Atomicity,原子性,所有的操作要么都成功,要么都失败。

  Consistency,一致性,数据在事务之前和之后保持数据的一致性。  

  Isolation,隔离性,在事务操作的过程中,其他操作不能访问和查看数据。

  Durability,一旦事务成功,在系统中产生的变化将是永久的。

  详细介绍参看:http://www.360doc.com/content/08/0426/18/61497_1217187.shtml

  

复制代码
代码
<!--<br/ /> <br/ /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ /> http://www.CodeHighlighter.com/<br/ /> <br/ /> -->using (DbConnection conn = db.CreateConnection())
{
conn.Open();
DbTransaction trans = conn.BeginTransaction();
try
{
// execute commands, passing in the current transaction to each one
db.ExecuteNonQuery(cmdA, trans);
db.ExecuteNonQuery(cmdB, trans);
trans.Commit(); // commit the transaction
}
catch
{
trans.Rollback(); // rollback the transaction
}
}
复制代码
  

 

  分布式的事务

  如果你的事务包含了访问不同的数据库,或者是包括了消息队列的访问,你必须使用分布式的事务。例如windows的Distributed transaction coordinator(DTC)服务。

  使用TransactionScope类

  

<!--<br/ /> <br/ /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ /> http://www.CodeHighlighter.com/<br/ /> <br/ /> -->using (TransactionScope scope
new TransactionScope(TransactionScopeOption.RequiresNew))
{
// perform data access here
}

 

  扩展模块使用其他类型的数据库

  企业库默认支持SQL Server、Oracle和SQL CE。但是你可以扩展来支持更多的数据库。自定义一个provider或者是引入第三方的provider。

  如果是自定义一个provider,你可以继承Database类,然后重写里面的一些方法。在方法中处理一些细节,例如返回值,参数的前缀(@),数据类型转换,和其他的一些相关因素。

转自:http://www.cnblogs.com/virusswb/archive/2010/05/16/Enterprise-Library-5-0-DataAccess-4.html

分享到:
评论

相关推荐

    sheng.ADO.NET.Plus:对原生 ADO.NET 的增强和辅助类,使其具备类似 ORM 操作的便利性,当从数据库中读取数据时,对内存中的 DataSet、DataTable、DataRow 进行动态映射。当向数据库写入数据时,根据操作的对象自动生成 SQL 语句并执行 ADO.NET 层面相应的操作

    支持所有数据库原生操作(基于微软企业库的数据模块,并集成了日志模块,所有数据库操作异常使用企业库写日志)解除与数据库表模型一一对应的关系,由开发人员灵活指定映射关系。支持直接使用SQL语句并根据查询结果...

    sas数据分析系统教程

    它由数十个专用模块构成,功能包括数据访问、数据储存及管理、应用开发、图形处理、数据分析、报告编制、运筹学方法、计量经济学与预测等等。 SAS系统基本上可以分为四大部分:SAS数据库部分;SAS分析核心;SAS开发...

    SQLHelper(C#)源代码微软官方原始无更改全功能版附调用源码

    翻箱底时找到了SQLHelper.cs,微软官方推出的sql server数据访问模块,仔细看了下,非阉割的版本(我一字没改),英文注释,功能齐全(一些教程上没介绍到的功能这里面也有),推荐刚学ASP.NET的新手下载来研究研究...

    精易模块[源码] V5.15

    相当于特殊功能支持库-&gt;取变量数据地址。 8、新增“类_环境存取”类模块,可以新建、编辑、删除当前用户或系统环境变量,无需重启立刻生效。 精易模块 V3.83 what’s new:(20140901) 1、改善“网页_访问”、...

    大数据分析平台.docx

    具体模块包括: 语义层:为统一的查询建模平台和数据访问接口。除提供标准的查询建模能力外,还有语义驱动、语义规则、语义函数、描述器等等扩展方式,满足不同层面的扩展要求。 OLAP引擎:OLAP引擎提供全面的多维...

    精易模块5.7易语言源码

    精易模块 V5.7 what's new: (20170501) 1、修复“目录_清空”,“目录_强力清空”,“目录_删除”,“目录_枚举子目录”,“目录_同步更新”,“目录_更新”,“目录_是否有子目录”,“目录_枚举子目录1”,命令...

    C#微软培训资料

    &lt;&lt;page 2&gt;&gt; page begin==================== 7.5 逻辑操作符和逻辑表达式.68 7.6 位 运 算 .69 7.7 其它特殊操作符 .72 7.8 小 结 .77 第八章 流 程 控 制 .79 8.1 条 件 语 句 .79 8.2 循 环 语 句 ....

    asp.net知识库

    asp.net 2.0-实现数据访问(1) ASP.NET 2.0 新特性 .NET 2.0里使用强类型数据创建多层应用 在MastPage中引用脚本资源 2.0正式版中callback的一些变化+使用示例(ASP.NET 2.0) asp.net 2.0 新特性 Visual Web ...

    微软海天技术大会综合系统 v1.0.rar

    微软海天技术大会综合系统由在线签到、注册、手机网、在线闯关、现场问答等各模块组合而成,通过调用统一的webservice服务来实现数据之前的共享。本系统已成功应用于2011-11.24举行的微软海天技术大会。 对各项目...

    万心宿舍人员管理系统

    4、采用微软ADO技术进行网络访问好处:使用户可以通过网络进行局域网访问数据服务器,方便简洁。 ●软件优势: 1、 随时可知道哪些铺位是空铺,可进行入住。 2、 随时可知道哪些企业的人员住在哪些铺位,并且知道该...

    mysql-connector-odbc

    SIMBA.DLL 和基于标准的数据访问诞生了。通过在程序中使用 ODBC 语句,您可以访问多个不同公共数据库中的文件。除了 ODBC 软件,每个要访问的数据库都需要一个单独的模块或驱动程序。 ODBC为客户端程序提供了访问...

    微软海天技术大会综合系统 v1.0

    本系统已成功应用于2011-11.24举行的微软海天技术大会. 本系统包含在线签到,注册,手机网,在线闯关,现场问答等各模块组合而成. 通过调用统一的webservice服务来实现数据之前的共享. 对各项目分别介绍一下: 1....

    Enterprise Library 3.0(二)

    &lt;br/&gt;Enterprise Library是微软Patterns & Practices 项目组 推出的公共模块解决方案,用来解决我们在企业级开发中遇到公共问题,如配置管理、数据访问、缓存管理、记录操作日志、异常管理、加密解密、权限管理...

    OPCUA.rar_OPC UA 服务器_c opc ua_dcom配置_opc ua core_opcua C#

    传统OPt服务器基于COM/DCOM组件技术,导致...采用服务器地址空间的节点、引用等核心技术,设计实现了地址空间的节点管理、数据管理、访问管理、订阅管理和视域管理等 功能类.设计完成了独立的OPC UA地址空间功能模块

    易语言程序免安装版下载

     静态编译后的易语言EXE/DLL之间不能再共享譬如窗口、窗口组件等类似资源,对于已经静态连接到一个EXE/DLL中的支持库,该支持库中的数据或资源将不能再被其它EXE/DLL中所使用的同名支持库访问。这是因为代码被分别...

    java图书管理系统毕业设计(源代码+论文)-jsp-java源程序代码.rar

    本系统使用的是美国微软公司的MICROSOFT VISUAL J++6.0。...Visual J++通过ActiveX Data Object(ADO, ActiveX数据对象)控件来访问数据,这是用于WFC应用程序的数据编程模块。ADO对象的内核包含Connection(连接)、Comma

    Enterprise Library 3.0(一)

    &lt;br/&gt;Enterprise Library是微软Patterns & Practices 项目组 推出的公共模块解决方案,用来解决我们在企业级开发中遇到公共问题,如配置管理、数据访问、缓存管理、记录操作日志、异常管理、加密解密、权限管理...

    依据ASP.NET教务管理平台-权限及公共模块设计与开发(毕业设计源代码+论文)

    RBAC实现了用户与访问权限的逻辑分离,更符合教务平台的用户、数据和应用特征;在公共模块中实现了系统通用的日志管理,异常处理,常用类库方法等。通过设计和应用本系统,有效的解决了教务平台中关于用户管理与权限...

    Enterprise Library 3.0(三)

    &lt;br/&gt;Enterprise Library是微软Patterns & Practices 项目组 推出的公共模块解决方案,用来解决我们在企业级开发中遇到公共问题,如配置管理、数据访问、缓存管理、记录操作日志、异常管理、加密解密、权限管理...

    ASP.NET 3.5 开发大全

    库、ASP.NET 访问其他数据源、ASP.NET MVC、LINQ 及Lambda 表达式、WCF 应用开发、WPF 应用开 发以及图形图像编程等内容。为了便于读者学习和理解ASP.NET 的知识,本书最后几章进行了不同的小型 模块的开发,以便...

Global site tag (gtag.js) - Google Analytics