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


Top 5 Contributors of the Month
david stephan
Post New Web Links

Strongly typed dataset exception handling

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net
 

Hey everyone,

I'm currently working on a 3-tier ASP.NET application (UI, BLL & DAL). The DAL uses a strongly typed dataset that I've created with the VS Dataset Wizard. My question is, what is the best way to handle exceptions originating from the BLL and DAL classes. I googled a bit and it seems that the most commonly used practice is to create DALException and BLLException classes and throw your own message. Is this the way forward? Could you please indicate how this can be done for an automatically generated DAL? What are the best practices? Examples with code are highly appreciated!!


Thanks,

Clayton




View Complete Post


More Related Resource Links

Strongly Typed DataSet Cleanup

  
Hey all, I've looked around and I can't seem to find a good answer on this. Is there any cleanup needed on a strongly typed dataSet? I'm using DataSets as my DAL but I don't really have a BLL. I'm handling this in my code behind like this: Private PunchAdapter As New PunchDSTableAdapters.PUNCHIMPORTTableAdapter Dim LastPunch As String = PunchAdapter.GetLastPunch(PersonNUM) PunchAdapter.InsertPunch(PunchID, ReqCode, PersonNUM, txtDate.Text, txtTime.Text) I'm assuming it handles the opening and closing of the connetion? The adapter has a dispose method. Should I be using this? Is there any cleanup necessary or does the partial class (that inherits system.data.dataset) handle all of this? Thanks!

How to use connection string and strongly-typed dataset which exists in another project ?

  

Hi

i have a winform application with huge strongly-typed dataSet. Now, i've decided to create a web edition of my application and i want to use strongly-typed typed dataSet which exists in my winform application. also it's tableAdapters create with the connection string settings which stored in my winforms app.config.

my problem is that how to use strongly-typed dataset of my winform app with new connection string which exists in my web app ?

thanks in advance


Timeout on dataadapter.Fill on strongly typed dataset

  

Hi friends,

               Error message shown "timeout expired.the timeout period elapsed prior to completion of the operation or the server is not responding "

                on filling the strongly typed dataset(ie. dataadapter.Fill(dataset.tablename)).  plz help me

regards

Lince   

 


Strongly Typed Dataset and Gridview: Problem

  

I am trying to populate a gridview using two tables. I also have a strongly typed dataset and used the method on this page:

http://www.asp.net/data-access/tutorials/creating-a-data-access-layer-vb

the problem is that, when i try to use two table the gridview does show up (I checked through debugging that the datatable comes back as empty).

I will be grateful for ur assistance or thoughts. Thank you


Strongly Typed Dataset

  

I have tables like CustomerDetails which have few fields like CustomerID, ContactName,Address,Phone,Email

and few other tables which may have primary and foreign key fields say Tables Orders which may contain fields like OrderID (PK), CustomerID (FK), ItemName,Quantity, Price, Total etc which may carry orders from customers and one customer have several orders at a time.

I need to create a strongly typed dataset and insert data into database.

Please help me out as I dont know strongly Typed Dataset


EXCEPTION HANDLING IN C#

  
Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

  
After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

Introducing ADO.NET and the Typed DataSet

  
In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

  
This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Introduction to strongly Typed Data Sets

  
This article teaches how to create a strongly-typed dataset class library in your C# database applications. Our objectives are as follows:

.Learn what an strongly-Typed Data Set is
.Let Visual Studio Create a ST Data Set
.(Semi)Manually create a ST Data Set using XSD (Xml Schema Definition)

SQL Server 2005 Try and Catch Exception Handling

  
I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

Error while using exception handling block el 4.1

  

Hi Folks,

 

i am trying to use tyhe exception handling block of Enterprise library 4.1.

 

I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.

 

During runtime I am getting an exception on the HandleException event, The exception is added below:

 

 

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

Data Points: SQL Server 2005 XML Support, Exception Handling, and More

  

SQL Server 2005 includes several important improvements to the Transact-SQL (T-SQL) language. One added feature is a new kind of trigger that fires when data definition language (DDL) statements run.

John Papa

MSDN Magazine May 2006


Data Points: Efficient Coding With Strongly Typed DataSets

  

Someone once said to me that the hallmark of a good developer is the desire to spend time efficiently. Developers are continually pursuing ways to make coding easier and faster, and to reduce the number of errors.

John Papa

MSDN Magazine December 2004


Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application

  

Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004


Categories: 
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