.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Issue with Data Access Layer DLL

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi, I am working on a project in which I have made changes to LINQ to SQL code in data access layer project. Initially the code was using Single() extension method, I have changed it to SingleOrDefault() was earlier method was throwing exception if no records found in db. After making changes I ran the project but during debugging VS 2008 was showing that file is changed and do you want to reload the file box. When selected the file, the debugger was still executing the commented code (Single() method). I tried cleaning the entire solution and rebuilding it but it did not help. All the projects (Presentation, BL, DAL) are under single solution. Can any one please help me to solve the issue? Thanks in advance.

View Complete Post

More Related Resource Links

Data Access: Implement a Data Access Layer for Your App with ADO.NET


Implementing data access functionality is a core activity of most developers working with the .NET Framework, and the data access layers they build are an essential part of their applications. This article outlines five ideas to consider when building a data access layer with Visual Studio .NET and the .NET Framework. The tips include taking advantage of object-oriented techniques and the .NET Framework infrastructure by using base classes, making classes easily inheritable by following guidelines, and carefully examining your needs before deciding on a presentation method and external interface.

Dan Fox

MSDN Magazine April 2003

Need help: "Adding Parameterized Methods to the Data Access Layer"

Hi all, em all new in C# and .NET.I am following this tutorial: http://www.asp.net/data-access/tutorials/creating-a-data-access-layer-csAnd i am at step 3: Adding Parameterized Methods to the Data Access Layer - i have No problems in getting out all information from my database.But when i try to get a specific item by CategoryID i get a Error.This is what i type in my Query in the table adapter:SELECT     ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, DiscontinuedFROM         ProductsWHERE CategoryID = @CategoryIDHere is the error i get when i click finish:The wizard detected the following problems when configuring TableAdapter Query "FillByCategoryID":Details:             Generated SELECT statement.              Error in WHERE clause near '@'.              Unable to parse query text.Can anyone help me with this problem?Someone who knows what i am doing wrong?Thanks

A SOA based Customizable Data Access Layer.Please comment

Hi, Actually I have an idea  to built a reusable package software .. The detail mentioned below.. ------------------------------------------------------------------------------------------ A SOA based Customizable Data Access Layer. Data access layer (DAL) is an essential part of almost every project. A data access layer can be build with all required methods(Like methods for fetching, inserting, updating data and also other methods can be built with required number of input parameters, which execute stored procedures.) in any language. Interfacing with the DAL would be a webservice. A webservice can be build with webmethods. The web service contains all web methods, which call all the methods in DAL, passing the appropriate parameters. Addition to those methods, webservice contains a method which takes database details as input parameters and passes the parameters to the method in DAL, which makes connection with database. Thus, the DAL layer and webservice, as a whole are acting as a complete package If the DAL and webservice can be built one time, it can be reused in any project with out modifying it.As the webservice is platform independent and language independent, any project can access the project/software for data operation. Using this product time can be saved so, deadline can be met easily. If this product is developed one time and can be reused by sever

Starting Data Access Layer Tutorials - Confusion on Database downloads

Hello.I have really enjoyed going through the Security Tutorials. They were well done and I think I learned a lot.I am just about to start the first Data Access Layer Tutorial. I am a little bit confused.I have MS SQL Server 2005 and MS Visual Studio 2005 on my laptop.The first tutorial says to download and use the Northwind database. But, the link in the tutorial goes to a MS page that says that the Northwind database is for SQL Server 2000 - although it will work with 2005. The page suggests that I use the AdventureWorks database with 2005. But, when I click on the link for that page it says that this database is now on CodePlex servers and gives me yet another link.I just want to use the right database for this tutorial. Can someone please explain to me what is the right process for this tutorial? Will I just be able to download and run the EXE for the Northwind database with what I have and immediately be able to start going throgh the tutorial? Or, will I need to make some adjustments since the Northwind DB is for SQL Server 2000? I just don't want to get something installed and then have to back out of it.Thanks.

Issue on MS Access linked to SQL data replica after synchronisation


We have a MS Access front end linked to an SQL 2005 database with around 200 tables. The database is setup with merge replication and an issue occurs on the publication database but after the data is synchronised. If a user tries to add a new record they get an error with #deleted record when trying to add new data into the tables from MS Access. After this first prompt for the deleted record the users can then operate as normal with no error messages and the system functions as normal. Another issue that occurs, but again only just after the data is synchronised, is that if the user requests to view all of the jobs for a particular client the very first time the search is performed a random un-related job is shown not the expected results, if the search is run again then it will funciton correctly until the next synchronisation is run.

Our tables have Unique IDs with automatic indentity and GUIDs. We have exactly the same solutions working on MSDE and SQL 2000 and there is no such problem on these system.

Any ideas would be most appreciated.


Same interface for service ann data access layer?


Should my service class implement the same interface as my DAL-class? Let's say I have an interface and two classes like this;

public interface IArticles
string[] GetArticles();

public class DAL : IArticles
public string []GetArticles(){...}

public class Service : IArticles
private IArticles _dal;
public Service()
_dal = new DAL();
public string[] GetArticles()
return _dal.GetArticles();


In this case, the Service uses BOTH inheritance and composition of the interface. What is the best solution?

Problem with connectionstring in data access layer



I am developing a web application in Visualt Studio 2008. I have a data access layer that is automatically generated using Visual Studio. After publising my site to IIS and tested it for several hours, two exceptions occured:

Not allowed to change the 'ConnectionString' property. The connection's current state is connecting.	   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)     at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)     at C2T.DataAccess.UsersDataSetTableAdapters.UsersTableAdapter.InitConnection() in C:\sejanhe\Click2Track\C2T.NET\C2T.DataAccess\UsersDataSet.Designer.cs:line 1378     at C2T.DataAccess.UsersDataSetTableAdapters.UsersTableAdapter.get_Connection() in C:\sejanhe\Click2Track\C2T.NET\C2T.DataAccess\UsersDataSet.Designer.cs:line 1159     at C2T.DataAccess.UsersDataSetTableAdapters.UsersTableAdapter.InitAdapter() in C:\sejanhe\Click2Track\C2T.NET\C2T.DataAccess\UsersDataSet.Designer.cs:line 1251     at C2T.DataAccess.UsersDataSetTableAdapters.UsersTableAdapter.get_Adapter() in C:\sejanhe\Click2Track\C2T.NET\C2T.DataAccess\UsersDataSet.Designer.cs:line 1149     at C2T.DataAccess.UsersDataSetTableAdapters.UsersTableAdapter.FillByUserNamePasswordAndStatus(UsersDataTable dataTable, String Usr_Names, String Usr_Pwd, Nullable`1 Usr_Status) in C:\

Tracing procedure calls from sql server in data access layer


Hi Guys

Pretty often I have to run the sql server profile to get some sql instructions from my application.


Is there a way I could get the instructions in my data layer instead of going to sql server profiler?


I am using the standard system.data.sqlcliente objects ( sqlconnection, sqlcommand, sqldatareader )



MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc


Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.


Thanks In Advance.

Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



data access library v4.1


Ive just started a project that will use the enterprise library 4.1 data access code blocks.  Its been years since ive used them, can anyone tell me what assemblies I need to reference in my project in order to use them ?  Ive referenced 


are there any others I need ?

Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny


Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010

Data Access: Building a Desktop To-Do Application with NHibernate


Building an NHibernate-based desktop application isn't any harder than building a web application, and in many cases NHibernate simplifies elements of session handling and concurrency.

Oren Eini

MSDN Magazine December 2009

EF Data Access: EF v2 and Data Access Architecture Best Practices


Developers deploy a wide variety of development philosophies and architecture styles. This article explores three common perspectives on application development and describes how the Entity Framework can be employed in each. Specifically, the article looks at the forms-centric, model-centric, and code-centric development styles and their relationship to the Entity Framework.

Tim Mallalieu

MSDN Magazine August 2009

Under the Table: How Data Access Code Affects Database Performance


In this article, the author delves into some commonly used ways of writing data access code and looks at the effect they can have on performance.

Bob Beauchemin

MSDN Magazine August 2009

Data Services: Access Your Data On Premise Or In The Cloud With ADO.NET Data Services


In this article the author looks at two versions of the same application--one consuming an on-premise Data Service, and one consuming an Azure Table Data Service to illustrate data access in the cloud.

Elisa Flasko

MSDN Magazine May 2009

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend