do not understand the following error

  • Thread starter Thread starter Yoramo
  • Start date Start date
Y

Yoramo

I'm getting the following error: "Cannot interpret token 'Child' at position
1."

when I run the following code:
sqlDataAdapter1.Fill(ds1,"Table1") ;
sqlDataAdapter2.Fill(ds1,"bbb") ;
ds1.Relations.Add("id2pk",ds1.Tables["Table1"].Columns["fk"],ds1.Tables["bbb
"].Columns["id"]) ;
ds1.Tables["Table1"].Columns.Add("Exp1",typeof(int),"Child(id2pk).id") ;

can any one explain?
Thanks in advance
Yoramo.
 
Hi Yoramo,

You need to use one of the aggregation functions on child, because there
might be more that one child rows.
This is what the help says:
However, because child relationships may return multiple rows, you must
include the reference to the child column in an aggregate function. For
example, Sum(Child.Price) would return the sum of the column named Price in
the child table.
 
is there a aggregation function for strings? I need my field to be of type
string.

Thanks
Yoramo


Miha Markic said:
Hi Yoramo,

You need to use one of the aggregation functions on child, because there
might be more that one child rows.
This is what the help says:
However, because child relationships may return multiple rows, you must
include the reference to the child column in an aggregate function. For
example, Sum(Child.Price) would return the sum of the column named Price in
the child table.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Yoramo said:
I'm getting the following error: "Cannot interpret token 'Child' at position
1."

when I run the following code:
sqlDataAdapter1.Fill(ds1,"Table1") ;
sqlDataAdapter2.Fill(ds1,"bbb") ;
ds1.Relations.Add("id2pk",ds1.Tables["Table1"].Columns["fk"],ds1.Tables["bbb
"].Columns["id"]) ;
ds1.Tables["Table1"].Columns.Add("Exp1",typeof(int),"Child(id2pk).id") ;

can any one explain?
Thanks in advance
Yoramo.
 
Hi Yoramo,

I don't think you can aggregate strings.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Yoramo said:
is there a aggregation function for strings? I need my field to be of type
string.

Thanks
Yoramo


Miha Markic said:
Hi Yoramo,

You need to use one of the aggregation functions on child, because there
might be more that one child rows.
This is what the help says:
However, because child relationships may return multiple rows, you must
include the reference to the child column in an aggregate function. For
example, Sum(Child.Price) would return the sum of the column named Price in
the child table.
ds1.Relations.Add("id2pk",ds1.Tables["Table1"].Columns["fk"],ds1.Tables["bbb
"].Columns["id"]) ;
ds1.Tables["Table1"].Columns.Add("Exp1",typeof(int),"Child(id2pk).id") ;

can any one explain?
Thanks in advance
Yoramo.
 
what can I do with strings?


Miha Markic said:
Hi Yoramo,

I don't think you can aggregate strings.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Yoramo said:
is there a aggregation function for strings? I need my field to be of type
string.

Thanks
Yoramo


Price
in
ds1.Relations.Add("id2pk",ds1.Tables["Table1"].Columns["fk"],ds1.Tables["bbb
ds1.Tables["Table1"].Columns.Add("Exp1",typeof(int),"Child(id2pk).id")
 
Hi,

I guess pretty much nothing.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Yoramo said:
what can I do with strings?


Miha Markic said:
Hi Yoramo,

I don't think you can aggregate strings.
ds1.Relations.Add("id2pk",ds1.Tables["Table1"].Columns["fk"],ds1.Tables["bbb
"].Columns["id"]) ;
ds1.Tables["Table1"].Columns.Add("Exp1",typeof(int),"Child(id2pk).id")
;

can any one explain?
Thanks in advance
Yoramo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top