Datagrid Template column is neither a DataColumn nor a DataRelatio

S

steveski

I am using a datagrid populated from a dataview which is populated from a mdx
query. If i use
<asp:BoundColumn DataField="[TableName].[ColumnName].[MEMBER_CAPTION]"
HeaderText="ColumnName"></asp:BoundColumn>
however if i use a templaye column

<asp:TemplateColumn HeaderText="bob"> <ItemTemplate> <asp:Label
runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.[TableName].[ColumnName].[MEMBER_CAPTION]") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateColumn>


i get an error
ColumnName is neither a DataColumn nor a DataRelation for table TableName.

I just dont understand
 
K

Ken Cox [Microsoft MVP]

Hey Steve,

That's an error that pops up when the syntax of the DataBinder isn't right.
I'd look for improper quotes somewhere.

Ken
 
S

steveski

Ken,
The problem seems to be with the fact that the MDX Query returns the data
with column names that include braces and dots. I renamed all of my dataset
columns and it works fine.
is there a way in aspx code to dereference a quote.
i have tried adding double and tripple and quadrouple quotes in a row and
also tried a back slash nothing seems to work.
if i were able to wrap single quotes around the
TableName.ColumnName.MemberCaption that may work


Ken Cox said:
Hey Steve,

That's an error that pops up when the syntax of the DataBinder isn't right.
I'd look for improper quotes somewhere.

Ken

steveski said:
I am using a datagrid populated from a dataview which is populated from a
mdx
query. If i use
<asp:BoundColumn DataField="[TableName].[ColumnName].[MEMBER_CAPTION]"
HeaderText="ColumnName"></asp:BoundColumn>
however if i use a templaye column

<asp:TemplateColumn HeaderText="bob"> <ItemTemplate> <asp:Label
runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.[TableName].[ColumnName].[MEMBER_CAPTION]") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateColumn>


i get an error
ColumnName is neither a DataColumn nor a DataRelation for table TableName.

I just dont understand
 
K

Ken Cox [Microsoft MVP]

Hi Steve,

Could you post a sample of the MDX query so I can experiment with it?

Ken

steveski said:
Ken,
The problem seems to be with the fact that the MDX Query returns the data
with column names that include braces and dots. I renamed all of my
dataset
columns and it works fine.
is there a way in aspx code to dereference a quote.
i have tried adding double and tripple and quadrouple quotes in a row and
also tried a back slash nothing seems to work.
if i were able to wrap single quotes around the
TableName.ColumnName.MemberCaption that may work


Ken Cox said:
Hey Steve,

That's an error that pops up when the syntax of the DataBinder isn't
right.
I'd look for improper quotes somewhere.

Ken

steveski said:
I am using a datagrid populated from a dataview which is populated from
a
mdx
query. If i use
<asp:BoundColumn DataField="[TableName].[ColumnName].[MEMBER_CAPTION]"
HeaderText="ColumnName"></asp:BoundColumn>
however if i use a templaye column

<asp:TemplateColumn HeaderText="bob"> <ItemTemplate> <asp:Label
runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.[TableName].[ColumnName].[MEMBER_CAPTION]") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateColumn>


i get an error
ColumnName is neither a DataColumn nor a DataRelation for table
TableName.

I just dont understand
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top