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

Use a bit(Boolean) in a DataList

Hi i have a table with my message. With a query i get the values Namn(varchar(50) , Message(Text) , Sent(datetime) , Seen(bit)

The Namn , Message and sent i just want to write out and it works.
But with the seen i dont want to write true or false or 1 and 0. I want to change a image..

How does it work? I dont have a clue to where to begin.

Here is my code that works today.


Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <asp:SqlDataSource ID="SQL_LAS_MESS" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
  4.         SelectCommand="SELECT TB_MESSAGE.MESSAGE, TB_MESSAGE.SENT, TB_USER.NAMN, TB_MESSAGE.SEEN,
  5. TB_MESSAGE.FROM_ID FROM TB_MESSAGE INNER JOIN TB_USER ON TB_MESSAGE.FROM_ID = TB_USER.USER_ID WHERE (TB_MESSAGE.TO_ID = @TO_ID) ORDER BY TB_MESSAGE.SENT DESC">
  6.         <SelectParameters>
  7.             <asp:QueryStringParameter Name="TO_ID" QueryStringField="USERID" />
  8.         </SelectParameters>
  9.     </asp:SqlDataSource>
  10.  
  11.  
  12.     <asp:DataList ID="Guestbook_List" runat="server" DataSourceID="SQL_LAS_MESS">
  13.  
  14.         <ItemTemplate>
  15.             <table border="1">
  16.                 <tr>
  17.  
  18.                     <td>
  19.                         Från :
  20.                         <a href="USERPAGE.aspx?USERID=<%# Eval("FROM_ID") %>">
  21. <asp:Label ID="NAMNLabel" runat="server" Text='<%# Eval("NAMN") %>'></asp:Label></a>
  22.                     </td>
  23.  
  24.                     <td>
  25.                         <asp:Label ID="SENTLabel" runat="server" Text='<%# Eval("SENT") %>'></asp:Label>
  26.                     </td>
  27.                 </tr>
  28.  
  29.                 <tr>
  30.                     <td colspan="2">
  31.                         <asp:Label ID="MESSAGELabel" runat="server" Text='<%# Eval("MESSAGE") %>'></asp:Label>
  32.                     </td>                    
  33.                 </tr>
  34.             </table>           
  35.         </ItemTemplate>
  36.  
  37.         <HeaderTemplate>
  38.             Gästbok
  39.         </HeaderTemplate>
  40.     </asp:DataList>
Mar 22 '07 #1
0 850

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: DC Gringo | last post by:
I have a datalist that will always return 2 records. The first record should be called "Latest Edition", the second "Previous Edition". How can I identify which is which in the .net code and...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
1
by: DotNetJunkies User | last post by:
Hi, I was wondering if it is possible to load datagrid into datalist programatically using ITemplate interface with the following structure and place intp placeholder control. PlaceHolder -...
2
by: Fabiano | last post by:
Please, i need to hide a Item(Collumn) of a DataList that is inside of another DataList based on some data that i my database returns. For a sample i created the code above, but it doesn't work....
0
by: Isz | last post by:
PROBLEM: This problem is related to the postback and handling events correctly. BACKGROUND: I have a datalist which acts as a tabbes list with horizontal layout. This datalist is bound to a...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
1
by: H5N1 | last post by:
Hello everybody I'm stuck for a long time with the following problem, so I will be really gratefull if you could help me a bit: I have a GridView nested in DataList (it's located in DataList's...
16
by: Shawnk | last post by:
I would like to perform various boolean operations on bitmapped (FlagsAttribute) enum types for a state machine design as in; ------------------- enum portState { Unknown, Open,
4
by: Miro | last post by:
I created a table with a bit datatype column. I created this column as "do not allow null" and default value of 0 Now when I go into the Database explorer, right click on the table and click on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.