473,666 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to bind a simple Table or similar to...

a custom object. Similar to how I bind a collection of objects to a
repeater. Is there a way to bind a single object to a Table? I could use a
repeater, but seems over kill for a single object.

Thanks for any help.
Feb 23 '06 #1
5 1393
forgot to add, ASP.NET 1.1

"Jaybuffet" wrote:
a custom object. Similar to how I bind a collection of objects to a
repeater. Is there a way to bind a single object to a Table? I could use a
repeater, but seems over kill for a single object.

Thanks for any help.

Feb 23 '06 #2
In the code-behind make a protected property that will go to the table and
derive the value you want to bind to. Bind to the property like this:

<td><%# SalesTotal %></td>

where SalesTotal is a protected property in the code-behind.

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:BB******** *************** ***********@mic rosoft.com...
a custom object. Similar to how I bind a collection of objects to a
repeater. Is there a way to bind a single object to a Table? I could use
a
repeater, but seems over kill for a single object.

Thanks for any help.

Feb 23 '06 #3
I was hoping to bind to the table, ie. <table DataSource=<%# myobj %> then
use <td><%# DataBinder.Eval (Container.Data Item, "property")%>td >
Creating protected properties in the code behind for each property in my
object may be a hassle, but its an option. Perhaps I am missing something.
Just wondering if there is another way.

Thanks for your reply

"Eliyahu Goldin" wrote:
In the code-behind make a protected property that will go to the table and
derive the value you want to bind to. Bind to the property like this:

<td><%# SalesTotal %></td>

where SalesTotal is a protected property in the code-behind.

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:BB******** *************** ***********@mic rosoft.com...
a custom object. Similar to how I bind a collection of objects to a
repeater. Is there a way to bind a single object to a Table? I could use
a
repeater, but seems over kill for a single object.

Thanks for any help.


Feb 23 '06 #4
Ok, what you are after is binding a table rather than binding to the table.

No, an html table doesn't support DataSource. Instead you can do something
like
<table>
<asp:repeater ... DataSource= ...>
<asp:ItemTempla te>
<tr><td><%# DataBinder.Eval (Container.Data Item, "property") %></td></tr>
</asp:ItemTemplat e>
</asp:repeater>
</table>

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:F2******** *************** ***********@mic rosoft.com...
I was hoping to bind to the table, ie. <table DataSource=<%# myobj %> then
use <td><%# DataBinder.Eval (Container.Data Item, "property")%>td >
Creating protected properties in the code behind for each property in my
object may be a hassle, but its an option. Perhaps I am missing
something.
Just wondering if there is another way.

Thanks for your reply

"Eliyahu Goldin" wrote:
In the code-behind make a protected property that will go to the table
and
derive the value you want to bind to. Bind to the property like this:

<td><%# SalesTotal %></td>

where SalesTotal is a protected property in the code-behind.

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:BB******** *************** ***********@mic rosoft.com...
>a custom object. Similar to how I bind a collection of objects to a
> repeater. Is there a way to bind a single object to a Table? I could
> use
> a
> repeater, but seems over kill for a single object.
>
> Thanks for any help.


Feb 23 '06 #5
Thats what I figured, but I was thinking a repeater might be over kill for a
single object, not a collection.

"Eliyahu Goldin" wrote:
Ok, what you are after is binding a table rather than binding to the table.

No, an html table doesn't support DataSource. Instead you can do something
like
<table>
<asp:repeater ... DataSource= ...>
<asp:ItemTempla te>
<tr><td><%# DataBinder.Eval (Container.Data Item, "property") %></td></tr>
</asp:ItemTemplat e>
</asp:repeater>
</table>

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:F2******** *************** ***********@mic rosoft.com...
I was hoping to bind to the table, ie. <table DataSource=<%# myobj %> then
use <td><%# DataBinder.Eval (Container.Data Item, "property")%>td >
Creating protected properties in the code behind for each property in my
object may be a hassle, but its an option. Perhaps I am missing
something.
Just wondering if there is another way.

Thanks for your reply

"Eliyahu Goldin" wrote:
In the code-behind make a protected property that will go to the table
and
derive the value you want to bind to. Bind to the property like this:

<td><%# SalesTotal %></td>

where SalesTotal is a protected property in the code-behind.

Eliyahu

"Jaybuffet" <Ja*******@disc ussions.microso ft.com> wrote in message
news:BB******** *************** ***********@mic rosoft.com...
>a custom object. Similar to how I bind a collection of objects to a
> repeater. Is there a way to bind a single object to a Table? I could
> use
> a
> repeater, but seems over kill for a single object.
>
> Thanks for any help.


Feb 23 '06 #6

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

Similar topics

1
25562
by: Achille Carette | last post by:
Hello all, I noticed a difference in the explain plans between JDBC using bind variables (PreparedStatement) and SQLPlus for the same query. The query made through JDBC using bind variables makes a full table scan, while the query made in SQLPlus, replacing the "?" by string literals uses an index. (Platform: Oracle 10.1 / Linux RedHat 9 / JDK 1.4.2 / Oracle 10g thin JDBC driver ) As a common practice is to write and optimize queries...
1
4676
by: Daniel Roy | last post by:
Hi gurus, I just started to look at a very slow-running SQL statement generated by an application (Siebel). I spooled the SQL from the application, replaced the bind variables by their values, and tuned from the Query Analyser. But after awhile, I realized that the statement using bind variables and the same statement using the values instead of the bind variables often have completely different execution plans! Is that normal? Can...
3
3596
by: Venkata C | last post by:
Hi! We are running DB2 V8 on z/OS in compatibility mode. There is one specific query (embedded as static SQL in a COBOL program) that causes the bind job to abend when we use the DEGREE(ANY) option. The bind works fine with DEGREE(1). The bind job binds the DBRM into a plan. The query uses parameter markers. If we replace the parameter markers with literals in the query, the bind goes through without problems. Also, if we change the...
3
2318
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and bind that to the datagrid? I have never done either (usually I get a recordset from a stored procedure and bind results directly). I also don't know which is faster. Whichever you suggest, can you give a couple lines of sample code? Thank...
3
5964
by: Bob Clegg | last post by:
I am in the same boat as Moondog on the 2nd July. I have a report designed against a dataset. Proved the datasset is OK by dropping a datagrid onto the form and it binds OK to the data. But the report is empty (except for headers). My method is similar to Moondog except the dataset is based on a SProc. The dataset is instantiated in FormA, passed to a DataHandling class which fills it. by executing the SProc it is then passed to the...
2
7977
by: Neo | last post by:
I put a similar post for CheckBoxes, but i want to use a Radio button & not a CheckBox I have a field named "Male" & this is of SQL BIT data type (SQL Server). How can i bind this field to a check box? I noticed that this field can be NULL, 0 or 1. But i'm having trouble binding this field to my check box. i get an error when i try the following,
2
3381
by: duancg | last post by:
Hi, I wonder if someone could help since I wasn't able to find the answer through search. I have a simple .aspx page that shows data from a database table, as a table in UI. Now the data uses 1~12 to represent months, but I want to show them as Jan/.../Dec. So I thought I could write a simple function to convert it and call that function in the Bind expression of DataList. However, I just couldn't find a way to pass the bind...
0
1348
by: sean worlock | last post by:
Hello all, I have googled like crazy for this with no sucess! I have a dataset containing a table with the following fields Table===Widths --------------------------------------------- WidthID---int (primary key) Width------decimal
6
6270
by: pretzla | last post by:
I have a PL/SQL script where I load data from a stored procedure into bind variables. Then, I insert that data from the bind variables into an Oracle table with a simple insert statement. The execution of the stored procedure and the insert are in a FOR-LOOP. insert into ccd_t (acct_id, acct_seq_no, acct_btn) values
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8878
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.