473,486 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checking data before fill

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
Nov 21 '05 #1
2 1291
=?Utf-8?B?UmFjaGVs?= <Ra****@discussions.microsoft.com> wrote in
news:FC**********************************@microsof t.com:
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.

Nov 21 '05 #2
=?Utf-8?B?UmFjaGVs?= <Ra****@discussions.microsoft.com> wrote in
news:B0**********************************@microsof t.com:
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.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1805
by: Bart Nessux | last post by:
I have a html form (generated by PHP) that users can fill out and submit into a database. Everything works fine. However, I'd like to check to make sure that each field in the form actually...
5
2470
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
3
4060
by: Snake | last post by:
I have a vb .net program which fills a data grid upon form load from an acccess database. This works great. Now, I have to add a combo box and use it to alter the underlying sql statement and...
1
6799
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
11
1527
by: Fernando Barsoba | last post by:
Hi all, I very much need your help here guys.. I'm working on a IPSec implementation, and when almost finished, I found a considerable problem. I'm sending a particular array + a key to a...
21
8686
by: jacob navia | last post by:
Many compilers check printf for errors, lcc-win32 too. But there are other functions that would be worth to check, specially memset. Memset is used mainly to clear a memory zone, receiving a...
2
7318
by: RSH | last post by:
Hi, Iam struggling with an application where I am trying to transfer a datarow from one sql server to another instance of sql server. The schmeas may be slightly different and I am getting an...
6
8133
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
4
1715
by: sengfoo | last post by:
Hi all, I need you all help me to solve my problem here. The problem im facing now is I have 2 tag to fill in which is <Specialization></Specialization> <JobRole></JobRole> JobRole's data...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.