Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
BRH 9
#DOTNET 8
#DATAACCESS 7
Data Access 5
.NET 2
VS2010 2
dot net 2
DAAB 2
#LINQ 2
LINQ 2

Archive · View All
May 2010 5
April 2010 3
May 2011 1
December 2010 1

Deepak Palkar's Blog

Configuring the Data Access Application Block

May 12 2010 4:43PM by Deepak Palkar   

I have mentioned Data Access Application Block in my previous posts and I thought it would be convenient to mention how to configure the Data Access Application Block in your project. Mr. Thiru Thangarathinam has written a very nice post about it in very detail hence I’ll just summarize it here.

To use the Data Access Application Block in your project, please follow these steps.

  1. Download and Install the Enterprise Library of your interest from here. (I have used 3.1 in my examples)
  2. After Installation, add the reference to the following assemblies in your project using “Add Reference”
    1. Enterprise Library Shared Library (Microsoft.Practices.EnterpriseLibrary.Common.dll)
    2. Enterprise Library Data Access Application Block (Microsoft.Practices.EnterpriseLibrary.Data.dll)
  3. In your Web.config or App.config add following configuration. Please notice, I am using AdventureWorks database.
<configuration>
	<configsections>
		<section type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
	Microsoft.Practices.EnterpriseLibrary.Data" name="dataConfiguration" />
	</configsections>
	<dataconfiguration defaultdatabase="AdventureWorksDB" />

	<connectionstrings>
		<add name="AdventureWorksDB"
			providername="System.Data.SqlClient"
			connectionstring="server=YourDBServer;database=AdventureWorks;Trusted_Connection=yes" />
	   </connectionstrings>
</configuration>

And than this should work.

static void GetCustomersWithCity_DAAB(string city)
{
    Database db = DatabaseFactory.CreateDatabase();
    string sql = "select c.FirstName, c.LastName  from Person.Contact c " +
                                        " inner join Person.Address a " +
                                        " on c.ContactID = a.AddressID " +
                                        " where a.City = @CityParam;";
    DbCommand cmd = db.GetSqlStringCommand(sql);
    db.AddInParameter(cmd, "@CityParam", DbType.String, city);
    DataSet ds = db.ExecuteDataSet(cmd);
}

Happy Coding!!

Tags: ADO.NET, Data Access, BRH, DAAB, #DATAACCESS, #DOTNET,


Deepak Palkar
177 · 1% · 269
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]