Hello All,
I'm wandering how I can work with a value pulled from a database before it gets flushed in to the DataList.
Here is an example:
Field fldActive in my DB is either 1 or 0, when it's 1 then I want to show it as 'Active'
and when it's 0 then I want to show it as 'Inactive'.
How can I do that before the DataList is filled ?
Here is the code I use to populate my Datalist:
Connect.ConnectionString = ConnStr
Adapter.SelectCommand = New OleDb.OleDbCommand(SQL, Connect)
Adapter.SelectCommand.Connection.Open()
Adapter.Fill(RQ_DS, "TABLE_Q"
DL_Q.DataSource = RQ_DS.Tables("TABLE_Q"
Page.DataBind()
The DataList looks like this:
<asp
ataList id="DL_Q" runat="server" Width="600px">
<ItemTemplate>
<table cellpadding="2" cellspacing="0" border="0" width="600" align="center"><tr><td width="30">
<table cellpadding="2" cellspacing="0" border="0" width="30"><tr>
<td><IMG SRC="ico_edit.gif" border="0"></td>
<td><IMG SRC="ico_del.gif" border="0"></td>
</tr></table>
</td>
<td width="529"><%# Container.DataItem("fldMEMO"
%></td>
<td width="30"> <%# Container.DataItem("fldACTIVE"
%></td>
<td width="11"><IMG SRC="ico_find.gif" border="0"></td>
</tr>
</table>
</ItemTemplate>
</asp
ataList>
"Taxes are the fees we pay for civilized society" G.W.
I'm wandering how I can work with a value pulled from a database before it gets flushed in to the DataList.
Here is an example:
Field fldActive in my DB is either 1 or 0, when it's 1 then I want to show it as 'Active'
and when it's 0 then I want to show it as 'Inactive'.
How can I do that before the DataList is filled ?
Here is the code I use to populate my Datalist:
Connect.ConnectionString = ConnStr
Adapter.SelectCommand = New OleDb.OleDbCommand(SQL, Connect)
Adapter.SelectCommand.Connection.Open()
Adapter.Fill(RQ_DS, "TABLE_Q"
DL_Q.DataSource = RQ_DS.Tables("TABLE_Q"
Page.DataBind()
The DataList looks like this:
<asp
<ItemTemplate>
<table cellpadding="2" cellspacing="0" border="0" width="600" align="center"><tr><td width="30">
<table cellpadding="2" cellspacing="0" border="0" width="30"><tr>
<td><IMG SRC="ico_edit.gif" border="0"></td>
<td><IMG SRC="ico_del.gif" border="0"></td>
</tr></table>
</td>
<td width="529"><%# Container.DataItem("fldMEMO"
<td width="30"> <%# Container.DataItem("fldACTIVE"
<td width="11"><IMG SRC="ico_find.gif" border="0"></td>
</tr>
</table>
</ItemTemplate>
</asp
"Taxes are the fees we pay for civilized society" G.W.