 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 26th, 2004, 10:06 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Manage data row by row in datagrid
Hi, I am trying to select specific data that should be assigned row by row, such as now that, I am having a datagrid like below:
CHEMICAL CODE NO. MANUFACTURER AREA USED
ARGON GS0001AA Malaysian Oxygen Berhad AM1 DA LAB
ARGON GS0001AA Malaysian Oxygen Berhad AM1 FASL ASSEMBLY (FOL)
ARGON GS0001AA Malaysian Oxygen Berhad AM1 FASL MOLD
ARGON GS0001AA Malaysian Oxygen Berhad AM1 GAS STORAGE AREA
BUEHLER FS0025AA Buehler, Ltd AM1 EPOXY CLEANING ROOM
BUEHLER FS0025AA Buehler, Ltd AM2 DA LAB
.....
.....
.....
I wish to change it into a style like this:
CHEMICAL CODE NO. MANUFACTURER AREA USED
ARGON GS0001AA Malaysian Oxygen Berhad AM1 DA LAB
AM1 FASL ASSEMBLY (FOL)
AM1 FASL MOLD
AM1 GAS STORAGE AREA
BUEHLER FS0025AA Buehler, Ltd AM1 EPOXY CLEANING ROOM
AM2 DA LAB
.....
.....
.....
The data is sort by "CHEMICAL", I am trying to figure out what method should I use so that the redundant data can be "checked" and return as "null" value, so no matter which field is sorted by, once the data is redundant should not be shown. This is a report to the end-user.
Thanx for ur help in advance.
|
|

July 27th, 2004, 01:44 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
What is the frontend you use?
_________________________
- Vijay G
Strive for Perfection
|
|

July 27th, 2004, 02:07 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
You may even be able to do it in the front-end, where using the ItemDataBound or ItemCreated events (since it goes row by row), do this:
- if the current results are the same as the values stored in variables
- set the cells to a blank value.
- store the values in variables
The first time it comes through, the variables are blank. Then do the calculation, since they aren't the same, the values are left alone. Then the values are stored in the variables. On the next pass through (and all other passes), if the values are the same, then set the cell to an otherwise, leave it alone.
Brian
Brian
|
|

July 28th, 2004, 07:42 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I not quite familiar with .Net yet, is front-end a XML features? Yup yesterday I tried to figure out in the way u have stated. I din use ItemDataBound and my code are such below:
The code behind:
Function Compare(ByVal Input As String) As String
Dim X As String
If (X = Input.ToString()) Then
Return "Testing"
Else
Return Input
X = Input
End If
End Function
HTML code in the design interface:
<Columns>
<asp:TemplateColumn HeaderText="Name Of Chemical">
<ItemTemplate>
<Table Border="0">
<tr>
<td><%# Compare(DataBinder.Eval(Container.DataItem, "fldProductName") ) %>
</td>
</tr>
</Table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
But nothing change, what have I done wrong? How to set a cell to a blank value?
|
|

July 29th, 2004, 04:17 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanx to ur logic guidance bmains, I solved it!!
<script language=" vb" runat="server">
Dim x As String
Function Compare (Input As String) As String
If (Input <> x) Then
x = Input
Return Input
End If
End Function
</script>
<Columns>
<asp:TemplateColumn HeaderText="Name Of Chemical">
<ItemTemplate>
<Table border="0">
<tr>
<td>
<%# Compare (DataBinder.Eval (Container.DataItem, "ChemicalName")) %>
</td>
</tr>
</Table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
|
|
 |