473,382 Members | 1,752 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,382 software developers and data experts.

Asp.Net repeater

In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></tdcan I can use any
variable name instead of "au_id". I need it becose i am taking this value
from several tables and there is slight difference in the name of filed
between tables. Kindly provide solution and thanks in advance
BIJU

Jan 15 '08 #1
4 1381
In the SQL that you are getting your data from;

SELECT
A.au_id as 'a_au_id',
B.au_id as 'b_au_id'
FROM
A
JOIN B on A .....

That way your results will rename the fields "a_au_id" and "b_au_id" rather
than having two "au_id" fields.

"BIJU" <BI**@discussions.microsoft.comwrote in message
news:C8**********************************@microsof t.com...
In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></tdcan I can use any
variable name instead of "au_id". I need it becose i am taking this value
from several tables and there is slight difference in the name of filed
between tables. Kindly provide solution and thanks in advance
BIJU


Jan 15 '08 #2
Hai Aidy,
Actually the problem with me is that I have 7 tables in my database and
depends upon the users selection different table will be processed. In each
table, there are some differece in the name of the fields. But in the data
binding in the repeater control, in the HTML part I have to mention the field
name. As it is taken from diff. tables, I cant specify the field name. Kindly
provide solution

"Aidy" wrote:
In the SQL that you are getting your data from;

SELECT
A.au_id as 'a_au_id',
B.au_id as 'b_au_id'
FROM
A
JOIN B on A .....

That way your results will rename the fields "a_au_id" and "b_au_id" rather
than having two "au_id" fields.

"BIJU" <BI**@discussions.microsoft.comwrote in message
news:C8**********************************@microsof t.com...
In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></tdcan I can use any
variable name instead of "au_id". I need it becose i am taking this value
from several tables and there is slight difference in the name of filed
between tables. Kindly provide solution and thanks in advance
BIJU


Jan 15 '08 #3
You're probably better off using code-behind and dynamically decided on what
your columns will bind to depending on your dataset. The way you are
binding now is fine for more static implementations, but not for what you
want to do.

"BIJU" <BI**@discussions.microsoft.comwrote in message
news:D6**********************************@microsof t.com...
Hai Aidy,
Actually the problem with me is that I have 7 tables in my database and
depends upon the users selection different table will be processed. In
each
table, there are some differece in the name of the fields. But in the data
binding in the repeater control, in the HTML part I have to mention the
field
name. As it is taken from diff. tables, I cant specify the field name.
Kindly
provide solution

"Aidy" wrote:
>In the SQL that you are getting your data from;

SELECT
A.au_id as 'a_au_id',
B.au_id as 'b_au_id'
FROM
A
JOIN B on A .....

That way your results will rename the fields "a_au_id" and "b_au_id"
rather
than having two "au_id" fields.

"BIJU" <BI**@discussions.microsoft.comwrote in message
news:C8**********************************@microso ft.com...
In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></tdcan I can use any
variable name instead of "au_id". I need it becose i am taking this
value
from several tables and there is slight difference in the name of filed
between tables. Kindly provide solution and thanks in advance
BIJU




Jan 15 '08 #4
Use aliases..

so it will be
SELECT field1 as a, field 2 as b FROM Table1
SELECT anotherfield1 as a, anotherfield 2 as b FROM Table1

and in your Repeater you would bind to aliases
DataBinder.Eval(Container.DataItem, "a")
DataBinder.Eval(Container.DataItem, "b")

George.
"BIJU" <BI**@discussions.microsoft.comwrote in message
news:D6**********************************@microsof t.com...
Hai Aidy,
Actually the problem with me is that I have 7 tables in my database and
depends upon the users selection different table will be processed. In
each
table, there are some differece in the name of the fields. But in the data
binding in the repeater control, in the HTML part I have to mention the
field
name. As it is taken from diff. tables, I cant specify the field name.
Kindly
provide solution

"Aidy" wrote:
>In the SQL that you are getting your data from;

SELECT
A.au_id as 'a_au_id',
B.au_id as 'b_au_id'
FROM
A
JOIN B on A .....

That way your results will rename the fields "a_au_id" and "b_au_id"
rather
than having two "au_id" fields.

"BIJU" <BI**@discussions.microsoft.comwrote in message
news:C8**********************************@microso ft.com...
In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></tdcan I can use any
variable name instead of "au_id". I need it becose i am taking this
value
from several tables and there is slight difference in the name of filed
between tables. Kindly provide solution and thanks in advance
BIJU




Jan 15 '08 #5

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

Similar topics

0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
2
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater...
2
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
4
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString;...
0
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.