PC Review


Reply
Thread Tools Rate Thread

Asp.Net repeater

 
 
BIJU
Guest
Posts: n/a
 
      15th Jan 2008
In repeater control, the databinding expression like <td><%#
DataBinder.Eval(Container.DataItem, "au_id") %></td> can 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

 
Reply With Quote
 
 
 
 
Aidy
Guest
Posts: n/a
 
      15th Jan 2008
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" <(E-Mail Removed)> wrote in message
news:C8C6A573-666D-456C-A976-(E-Mail Removed)...
> In repeater control, the databinding expression like <td><%#
> DataBinder.Eval(Container.DataItem, "au_id") %></td> can 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
>
>



 
Reply With Quote
 
BIJU
Guest
Posts: n/a
 
      15th Jan 2008
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" <(E-Mail Removed)> wrote in message
> news:C8C6A573-666D-456C-A976-(E-Mail Removed)...
> > In repeater control, the databinding expression like <td><%#
> > DataBinder.Eval(Container.DataItem, "au_id") %></td> can 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
> >
> >

>
>
>

 
Reply With Quote
 
Aidy
Guest
Posts: n/a
 
      15th Jan 2008
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" <(E-Mail Removed)> wrote in message
news6AADFB8-99C9-4BFA-8112-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:C8C6A573-666D-456C-A976-(E-Mail Removed)...
>> > In repeater control, the databinding expression like <td><%#
>> > DataBinder.Eval(Container.DataItem, "au_id") %></td> can 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
>> >
>> >

>>
>>
>>

>



 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      15th Jan 2008
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" <(E-Mail Removed)> wrote in message
news6AADFB8-99C9-4BFA-8112-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:C8C6A573-666D-456C-A976-(E-Mail Removed)...
>> > In repeater control, the databinding expression like <td><%#
>> > DataBinder.Eval(Container.DataItem, "au_id") %></td> can 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
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
asp.net repeater Howard Microsoft C# .NET 3 25th Mar 2006 06:58 AM
Repeater inside a repeater....how? voidfill3d@yahoo.com Microsoft ASP .NET 1 10th Aug 2005 02:58 PM
Repeater Using Javascript Referencing a Column in the Repeater rwoo_98@yahoo.com Microsoft ASP .NET 0 26th Feb 2005 05:02 PM
Repeater control with nested repeater chris.reed@digus.com Microsoft ASP .NET 0 11th Feb 2005 05:10 PM
Nested Repeater Child Repeater Manipulation on Render dh Microsoft Dot NET 1 5th Apr 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 PM.