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

Master Detail DataGrid problem

Hi,

i wanted to know how i could resolve the following error
message:

there in an error in my application when i am trying to
retrieve a row a row from a detail table based on the key
field in a master table into a datagrid

Actually when i am retrieving a row form a table there
isnt any row in a detail table?

How can i resolve my problem ?

How can i check whether there is a row in a detail table
with master tables key field?

There is a statement in my application

row=myDataset.Tables[0].Rows[0];

here there is an runtime error saying

There is no row at position 0.

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.IndexOutOfRangeException: There
is no row at position 0.
Thank you in advance

Jul 21 '05 #1
1 2307
Try doing this:

if(myDataset.Tables[0].Rows.Count != 0)
{
row = myDataset.Tables[0].Rows[0];
}
-----Original Message-----
Hi,

i wanted to know how i could resolve the following error
message:

there in an error in my application when i am trying to
retrieve a row a row from a detail table based on the keyfield in a master table into a datagrid

Actually when i am retrieving a row form a table there
isnt any row in a detail table?

How can i resolve my problem ?

How can i check whether there is a row in a detail table
with master tables key field?

There is a statement in my application

row=myDataset.Tables[0].Rows[0];

here there is an runtime error saying

There is no row at position 0.

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and whereit originated in the code.

Exception Details: System.IndexOutOfRangeException: Thereis no row at position 0.
Thank you in advance

.

Jul 21 '05 #2

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

Similar topics

1
by: Juan | last post by:
I built a form that displays a master-detail relation ship, now i need to add a column to the datagrid displaying the master data, this column corresponds to the text name of a column stored in the...
8
by: Christopher Weaver | last post by:
I'm having the hardest time doing the simplest thing. I have a DataGrid bound to a table in a master detail DataRelation within a DataSet relTaskActivities = new DataRelation("TaskActivities",...
2
by: Marcel | last post by:
Hi, I'm new to VS and ASP.NET and have a question about master/detail datagrids. I have a master datagrid filled with data via a component that contains a SQL adapter. Now I would like to fill...
2
by: ruca | last post by:
Hi, I have a master and a detail datagrid. I put detail grid showing insise of a column of master grid. The problem is that it's not what I really want. What I really want would be that the...
4
by: M | last post by:
Hy, I would like to create a master /detail datagrid, that is a datagrid that (when I click on an item) shows some other item's details expanding the rows under the selected grid Can someone...
1
by: solex | last post by:
Hello, I am trying (unsuccessfully) to display a Master-Detail-Detail records. The problem comes in the second detail grid. The first detail grid is displaying correctly but it is not...
2
by: Ken C | last post by:
I've setup a Master detail table from a typed dataset on 2 different data grid The first one I bind it with the Master data table name The second data set I bind it with the MasterDetail...
1
by: | last post by:
Hi, i wanted to know how i could resolve the following error message: there in an error in my application when i am trying to retrieve a row a row from a detail table based on the key field...
1
by: Gary200 | last post by:
Hello All, I bind two datagrids in a master-detail relationship successfully. What I want is to set allowNew and allowDelete disabled in both datagrid using dataview. The code like this: ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.