473,395 Members | 1,937 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.

Parent/Child Datagrid

Hi All

My apologies for posting this here but the Delphi newsgroup is very
slow.

Using Borland Developer Studio 2006 - creating a C# .net application.

I have a datagrid (id = "Documents") on a form with a button (a test
app at this point).
In the button event I have the following code which I would like to
populate the datagrid
with Parent Child data relationship records. When I compile this I get
a couple of errors.
Here is the code with error points indicated

OleDbConnection conoper = new OleDbConnection("provider=IBMDA400;Data
Source=XXX.XXX.XXX.XXX;User Id=XXXXXXXXXX;password=XXXXXXXXXX");
OleDbCommand cmdoper = new OleDbCommand();

DataSet ds = new DataSet();

string LSqlString1 = "Select DOCNAME, CELL, WORKSTATN, PRODUCT,
DOCCAT, DOCPATH, SUBMITDATE, SIGNEDOFF From WRKINSTRUC.SIGNOFFDOC";
conoper.Open();
cmdoper.Connection = conoper;
cmdoper.CommandType = CommandType.Text;
cmdoper.CommandText = LSqlString1;
OleDbDataReader dsParent = cmdoper.ExecuteReader();
conoper.Close();

string LSqlString2 = "Select DOCNAME, CELL, WORKSTATN, PRODUCT,
DOCCAT, DOCPATH, SUBMITDATE, SIGNEDOFF From WRKINSTRUC.SIGNOFFDOC";
conoper.Open();
cmdoper.Connection = conoper;
cmdoper.CommandType = CommandType.Text;
cmdoper.CommandText = LSqlString2;
OleDbDataReader dsChild = cmdoper.ExecuteReader();
conoper.Close();

/* from here I am winging it */

/*
Compile problem here indicating datasources do not have Fill
definitions
[C# Error] WebForm1.aspx.cs(75): 'System.Data.OleDb.OleDbDataReader'
does not contain a definition for 'Fill'
*/

dsParent.Fill(ds, "Parent");
dsChild.Fill(ds, "Child");

/* additional compile messages
[C# Error] WebForm1.aspx.cs(78): No overload for method 'this' takes
'5' arguments
*/
ds.Relations.Add("UnsignedDocuments",
ds.Tables["Parent"].Columns["DOCNAME", "CELL", "WORKSTATN", "PRODUCT",
"DOCCAT"],
ds.Tables["Orders"].Columns["DOCNAME", "CELL",
"WORKSTATN", "PRODUCT", "DOCCAT"]);

Documents.DataSource = ds;
Documents.DataMember = "Docs";

Has anyone any ideas on how I rectify this problem ?

Or am I way Off beam :-)

Many thanks in advance for any assistance offered

Iain

Feb 8 '07 #1
0 2285

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

Similar topics

0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
0
by: Ross | last post by:
ASP.NET Problem: I have a dataset with a parent table and a child table. For every row in the parent table there are ~1/2 dozen corresponding records in the child table. In the ASPX page I have a...
1
by: Roy | last post by:
How is it done? BTW, I'm reposting this here, as the datagrid newsgroup appears functionally comatose... I have a nested datagrid setup. When one updates the child grid using edit, it also...
3
by: Skowronek | last post by:
What is the best method to obtain a data value from a parent datagriditem from a child datagrid - datagrid footer item command event handler? Here is the layout of my asp.net controls ...
1
by: Andy | last post by:
Hello, I have a datagrid within another datagrid. The innder datagrid contains a dropdownlist which fires an event as index change (OnSelectedIndexChanged). I can get the ItemIndex of the...
0
by: DraguVaso | last post by:
Hi, I have in my VB.NET-application a DataGrid with two DataTables in with a Parent-Child-relationship defined. When the users clicks on a call in the DataGrid, i want to know the MappingName...
8
by: Richard L Rosenheim | last post by:
I have a dataset containing a parent table related to a child table. The child table contains an ID field (which is configured as autonumber in the datatable), the ID of the parent, plus some...
1
by: Aaron Smith | last post by:
I have a parent table that has one child table. The parent has a single field (ID, AutoIncrement, Seed 0, Step -1 in the DataSet, Seed 1, step 1, in DataSource). The child is linked to this ID...
0
by: hott5hotj | last post by:
in Actionscript 3.0 Ive created a datagrid that populated with data. I want to create a pop up window to confirm whether the removal of an entry. When I call from the child object the following, I...
1
by: Sep410 | last post by:
Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql1 As String Dim sql2 As String Dim da1 As SqlDataAdapter ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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,...

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.