473,386 Members | 1,606 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,386 software developers and data experts.

Trouble retrieving data from a dataset to a datarow.

Hi,

I'm trying to fill a dataRow from a dataset. But now i'm wondering,
what do i do if the Dataset does not contain the requested
information?

For Example :
c_CompGroupRij = c_dsCompGroup.tComponentGroup.FindByCompgroupId(cG roupId);

I try to find a row in the Dataset (c_dsCompGroup) that has cGroupId
as an ID, in order to display this row on screen.
But if It does not contain that ID, how do I check this before I do
this:
this.cGroupName = c_CompGroupRij.Cgroupname;
this.IsActive = c_CompGroupRij.IsActive;

Thanks
Dirk Vervecken
Nov 15 '05 #1
1 1136
Dirk,

I would think that your FindByCompgroupId method would return null, or
an array with zero elements in it. You should check for either or both of
these cases.

Also, you can look in the code for this class (the strongly typed
datasets are just pieces of code inserted into your project) to see what the
return result is. However, I believe that these functions are based on the
Select method on the DataTable class, which should return an array with zero
elements. However, it never hurts to check against null.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dirk Vervecken" <Ve*********@hotmail.com> wrote in message
news:79*************************@posting.google.co m...
Hi,

I'm trying to fill a dataRow from a dataset. But now i'm wondering,
what do i do if the Dataset does not contain the requested
information?

For Example :
c_CompGroupRij = c_dsCompGroup.tComponentGroup.FindByCompgroupId(cG roupId);
I try to find a row in the Dataset (c_dsCompGroup) that has cGroupId
as an ID, in order to display this row on screen.
But if It does not contain that ID, how do I check this before I do
this:
this.cGroupName = c_CompGroupRij.Cgroupname;
this.IsActive = c_CompGroupRij.IsActive;

Thanks
Dirk Vervecken

Nov 15 '05 #2

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

Similar topics

6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
2
by: AndyJ | last post by:
Hi and thanks in advance for any assistance recieved, There is most likely a simple solution to this as usual... I am trying to access data from an Excell worksheet using ADO. The problem is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...
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...

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.