Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Help with DataColumn.Expression

Reply
Thread Tools

Help with DataColumn.Expression

 
 
Lee Franke
Guest
Posts: n/a
 
      10-14-2003
I'm trying to implement Child.ColumnName as in this example.

http://msdn.microsoft.com/library/de...ssiontopic.asp

I am attempting to use the line.
DataColumn.Expresson = "Child.AdminName";

I get the error "Cannot interpret token 'Child' at position 1".

The DataRelation does exist.

Has anyone done this successfully before?

Thanks,

lee franke


 
Reply With Quote
 
 
 
 
Prasad
Guest
Posts: n/a
 
      10-14-2003
Hi

Please post your code so that it will be easy to fix.

Prasad

"Lee Franke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to implement Child.ColumnName as in this example.
>
>

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatacolumnclassexpressiontopic.asp
>
> I am attempting to use the line.
> DataColumn.Expresson = "Child.AdminName";
>
> I get the error "Cannot interpret token 'Child' at position 1".
>
> The DataRelation does exist.
>
> Has anyone done this successfully before?
>
> Thanks,
>
> lee franke
>
>



 
Reply With Quote
 
 
 
 
Lee Franke
Guest
Posts: n/a
 
      10-14-2003
Here ya go

Code that sets up the relationship
DataColumn parentCol;

DataColumn childCol;

parentCol = dsResults.Tables["People"].Columns["adminID"];

childCol = dsResults.Tables["Admins"].Columns["employeeID"];

DataRelation myRptRelation = new
DataRelation("AdminNames",parentCol,childCol,false );

dsResults.Relations.Add(myRptRelation);



Code that adds the column
//now add a NEW column that will populate the admin's name
DataColumn cName = new DataColumn();

cName.DataType = System.Type.GetType("System.String");

cName.ColumnName = "adminName";

cName.Expression = "Child.displayName" ;

dsResults.Tables["People"].Columns.Add(cName);

Thanks,

lee franke


"Prasad" <(E-Mail Removed)> wrote in message
news:%23jGj%(E-Mail Removed)...
> Hi
>
> Please post your code so that it will be easy to fix.
>
> Prasad
>
> "Lee Franke" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm trying to implement Child.ColumnName as in this example.
> >
> >

>

http://msdn.microsoft.com/library/de...us/cpref/html/
> frlrfsystemdatadatacolumnclassexpressiontopic.asp
> >
> > I am attempting to use the line.
> > DataColumn.Expresson = "Child.AdminName";
> >
> > I get the error "Cannot interpret token 'Child' at position 1".
> >
> > The DataRelation does exist.
> >
> > Has anyone done this successfully before?
> >
> > Thanks,
> >
> > lee franke
> >
> >

>
>



 
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
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
HELP - HELP - HELP =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?= ASP .Net 4 03-09-2006 12:46 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments