Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Parent/Child Datagrid

Reply
Thread Tools

Parent/Child Datagrid

 
 
Iain
Guest
Posts: n/a
 
      02-08-2007
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(7: 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments