PC Review


Reply
Thread Tools Rate Thread

ADO .NET Data Validation 2.0

 
 
=?Utf-8?B?R2lvdmFubmk=?=
Guest
Posts: n/a
 
      8th Dec 2005
Hi All,

I am using VS 2005 and ADO.NET 2.0 to build a Windows Forms. I am
binding my data source to a datagridview and would like to know the following:

Where is the best place to perform data validation
(invalid/out-of-range column values, invalid text, etc...)? Do I perform it
in some DataGridView event before changing to the next row? If so, which
event? OR, do I use the partial class generated by the Dataset Designer. I
guess using the latter approach would be more application centric as I can
implement various forms and whatever is my "save" method, it would execute
the same validation processes on a per table and per column basis. What is
the best practice, or "new way of doing things" when it comes to data
validation with ADO .NET 2.0/VS 2005? Any examples or sample code of this?

Regards,

Giovanni
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      8th Dec 2005
My personal preference is to validate on the business layer. As Microsoft
drag and drop drops out the business layer, this is only applicable when you
do not use the MS FUD. I will generally attempt to validate on the UI, as
well, to avoid trips, but you should always validate before attempting a
data run.

If you are using a DataGrid view to edit individual records, you end up with
a button click event to submit back. You can run a validation check here.
The code, as mentioned, should be in the business layer, but you can thin
that out to start and refactor later, if it makes your life easier. If your
DataSets are strongly typed, you have the option of using them for some, if
not all, of your validation.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
"Giovanni" <(E-Mail Removed)> wrote in message
news:653A99C7-1C95-432D-8FF4-(E-Mail Removed)...
> Hi All,
>
> I am using VS 2005 and ADO.NET 2.0 to build a Windows Forms. I am
> binding my data source to a datagridview and would like to know the
> following:
>
> Where is the best place to perform data validation
> (invalid/out-of-range column values, invalid text, etc...)? Do I perform
> it
> in some DataGridView event before changing to the next row? If so, which
> event? OR, do I use the partial class generated by the Dataset Designer.
> I
> guess using the latter approach would be more application centric as I can
> implement various forms and whatever is my "save" method, it would execute
> the same validation processes on a per table and per column basis. What
> is
> the best practice, or "new way of doing things" when it comes to data
> validation with ADO .NET 2.0/VS 2005? Any examples or sample code of
> this?
>
> Regards,
>
> Giovanni



 
Reply With Quote
 
Jay Pondy
Guest
Posts: n/a
 
      9th Dec 2005
What is MS FUD?


On Thu, 8 Dec 2005 12:27:40 -0600, "Cowboy \(Gregory A. Beamer\)"
<(E-Mail Removed)> wrote:

>My personal preference is to validate on the business layer. As Microsoft
>drag and drop drops out the business layer, this is only applicable when you
>do not use the MS FUD. I will generally attempt to validate on the UI, as
>well, to avoid trips, but you should always validate before attempting a
>data run.
>
>If you are using a DataGrid view to edit individual records, you end up with
>a button click event to submit back. You can run a validation check here.
>The code, as mentioned, should be in the business layer, but you can thin
>that out to start and refactor later, if it makes your life easier. If your
>DataSets are strongly typed, you have the option of using them for some, if
>not all, of your validation.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom data validation on cells with data validation values AKrobbins Microsoft Excel Worksheet Functions 2 21st Jun 2011 04:20 PM
Data Validation -> Validation list is larger than the cell width Barb Reinhardt Microsoft Excel Programming 1 4th Mar 2010 08:24 PM
Crazy Data Validation ... List Validation Not Working TW Bake Microsoft Excel Programming 1 29th Mar 2007 02:41 AM
data validation invalid in dynamic validation list ilia Microsoft Excel Programming 0 7th Nov 2006 12:54 PM
When pasting data into a column with data validation I lose validation check Brad Microsoft Excel Misc 5 17th Apr 2004 01:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:32 AM.