473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DataRow RowError - Detecting at Table Level.

Hi,

I have a DataTable. When the table is validated, I'm setting the
DataRow.RowError text for certain rows that don't match a particular
criteria. This puts a nice red '!' on the DataGrid that is displaying the
DataTable.

Later on, I want to check to see if there are any 'faulty' rows in the
datatable. Is there a way to to a single check at the table level, or do I
need to loop through each row and see if the RowError text is set?
What I'm really looking for is somthing like a DataTable.HasErrorRows
property...

Anyone able to help?

Using C#, VS2003 and DotNET Framework 1.1 SP1

Thanks,

Chris.

Jul 17 '06 #1
1 2177

"ChrisM" <ch**************@suedeyahoo.comwrote in message
news:eU**************@TK2MSFTNGP05.phx.gbl...
Hi,

I have a DataTable. When the table is validated, I'm setting the
DataRow.RowError text for certain rows that don't match a particular
criteria. This puts a nice red '!' on the DataGrid that is displaying the
DataTable.

Later on, I want to check to see if there are any 'faulty' rows in the
datatable. Is there a way to to a single check at the table level, or do I
need to loop through each row and see if the RowError text is set?
What I'm really looking for is somthing like a DataTable.HasErrorRows
property...

Anyone able to help?

Using C#, VS2003 and DotNET Framework 1.1 SP1

Thanks,

Chris.
Ok, answered my own question. Seeing as no-one else could be bothered...
:-)

Should have looked more carefully I guess, not really sure how I missed this
before.
DataTable has a 'GetErrors' method which returns an array of any DataRows
that have an error set. A check of GetLength(0) for this array will, of
course, tell me if there ARE any rows with an error.

Chris.
Jul 18 '06 #2

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

Similar topics

5
by: Jole | last post by:
Hi I'm writing a program that needs to read from a file. In order for the program to be robust, it should somehow check that the file isn't corrupt, or stuffed in any way. For example, that...
6
by: Csaba2000 | last post by:
How do I detect when the font size has been changed (especially by user action: either Ctrl+Scroll wheel or View/Text Size)? This is just for use on IE 5.5+, but it would be great if there was a...
2
by: VMI | last post by:
Assuming I have a datarow (or a datarow collection), would it possible to create an Access table and dump the datarow(s) into that Access table? I wouldn't even need to create the fields in the...
1
by: VMI | last post by:
Assuming I have a datarow (or a datarow collection), would it possible to create an Access table and dump the datarow(s) into that Access table? I wouldn't even need to create the fields in the...
3
by: Jon S via DotNetMonster.com | last post by:
Hi all, I'm having a problem updating a simple change I've made to a Access 2000 table through databinding. The error I get is : An unhandled exception of type...
4
by: Michael Carr | last post by:
I have a function that populates a class with values from a database. I'd like to pass into the function either a SqlDataReader or a DataRow, depending on which mechanism I'm using to retrieve data...
6
by: JIM.H. | last post by:
Hello I have; DataRow dr= dataSet11.myTable.NewRow(); And I am filling the fields of this datarow. Now I need to create a copy of this row as drCopy and change a few fields and add both to...
1
by: Arpan | last post by:
This is how I am dynamically adding a table to a DataSet: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'Create an empty DataSet Dim dSet As New DataSet ...
8
by: squash+go | last post by:
For an abstract algebra class that I will be teaching, I'm trying to convert a text-based game that I wrote in Common Lisp to a graphical game in javascript. (I know nothing of javascript, but I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.