PC Review


Reply
Thread Tools Rate Thread

Checking data before fill

 
 
=?Utf-8?B?UmFjaGVs?=
Guest
Posts: n/a
 
      10th Aug 2004
Hi All:

I would like to know how to prevent a dataset from being filled with garbage
data.

Forinstance, if I am importing data from an excel spreadsheet into a
dataadapter and the first column has data with decimal places and I do not
want ANY data to go into the dataset if this condition is true, instead I
want to have a message box appear telling the user what is wrong. How should
I code this? I will do the same sort of thing with other columns. I would
like to prevent any slowness in the fill due to this.

Rachel
 
Reply With Quote
 
 
 
 
Anon-E-Moose
Guest
Posts: n/a
 
      10th Aug 2004
=?Utf-8?B?UmFjaGVs?= <(E-Mail Removed)> wrote in
news:FC938CA3-E13F-4ACB-92E5-(E-Mail Removed):

> Hi All:
>
> I would like to know how to prevent a dataset from being filled with
> garbage data.


Don't select any garbage data

> Forinstance, if I am importing data from an excel spreadsheet into a
> dataadapter and the first column has data with decimal places and I do
> not want ANY data to go into the dataset if this condition is true,
> instead I want to have a message box appear telling the user what is
> wrong. How should I code this?


Check the data before filling. For example, you could loop through certain
columns with a datareader to check the data.

Or fill the dataset, then skip certain columns.

Removing a couple of columns usually does not speed up your
dataadpater.fill too much. If you notice that that DA.fill is slow, you
maybe putting too much data into a dataset.

 
Reply With Quote
 
Anon-E-Moose
Guest
Posts: n/a
 
      10th Aug 2004
=?Utf-8?B?UmFjaGVs?= <(E-Mail Removed)> wrote in
news:B00D0CE7-926F-4AE5-8E48-(E-Mail Removed):

> Yes, I want to prevent my datagrid from being filled with incorrect
> data. So you are saying to fill a datareader with all the data have
> my code loop through it and if it is incorrect then throw the error?


Yes.

Or another possiblity is to build your own datatable and put constaints on
the columns - i.e. Integer data only.

Or you can place those contrainst into your database, and therefore you
never have to do these checks in the first place.

 
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
Checking entered data against exisitng data TonyR Microsoft Excel Programming 1 31st May 2007 07:07 PM
checking data in two rows and change the data accordingly =?Utf-8?B?UHVybmltYSBTaGFybWE=?= Microsoft Access Queries 11 21st Dec 2005 06:10 PM
I have a list of data, fill in the gaps. FILL function won't work =?Utf-8?B?VHJpdg==?= Microsoft Excel Misc 1 17th Sep 2005 02:33 PM
checking correct input with fill-in field rmc Microsoft Word New Users 1 7th Aug 2005 10:24 PM
checking correct input with fill-in field rmc Microsoft Word Document Management 0 7th Aug 2005 09:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:16 PM.