473,785 Members | 2,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.T ables[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.IndexOut OfRangeExceptio n: There
is no row at position 0.
Thank you in advance

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

if(myDataset.Ta bles[0].Rows.Count != 0)
{
row = myDataset.Table s[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.IndexOut OfRangeExceptio n: 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
459
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 master table as an integer (the foreign key, i need to display the text name of the foreign key stored in the third table). Do i have to create another datatable in the dataset im using that includes all the information I need? Change the Sql...
8
2054
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", parentCol, childCol); dsTaskActivities.Relations.Add(relTaskActivities); dgActivity.SetDataBinding(dsTaskActivities, "Tasks.TaskActivities"); This works fine. I have a properly behaving master detail relationship.
2
1469
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 a detail datagrid (which will contain a number of detail records) based on the selected master. Is it possible to
2
423
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 detail grid appears between rows of master grid, i.e., when I select one record in master grid that detail grid appears between the selected row and next row. I know that the reason why my detail grid is show in one master column it's because I...
4
1455
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 help me with this? Thanks!
1
1478
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 controlling the second grid. Here is some code that I am using to initialize the binding: txtName.DataBindings.Add("Text", dsFundOwner, "FundOwner.Name") txtNote.DataBindings.Add("Text", dsFundOwner, "FundOwner.Note")...
2
1998
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 Relation name so that I can obtain a "Detail Auto change" effect when current master record is moving around, which is suggested on syncfusion FA http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q780 But the problem is when I try to update a new...
1
418
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 in a master table into a datagrid Actually when i am retrieving a row form a table there
1
1531
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: Dim masterGrid As DataGrid Dim detailGrid As DataGrid
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10090
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7499
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.