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

Datagrid not displaying new column

Hello all,
The problem I am having is in one of the datagrids I added a new column.
When I run the application data is not shown in the new column. I am using
VS.NET 2003 and am connecting to a sql database(Oracle 10g). Before adding
the new column the other fields show up. The other fields still show up but
not the one I had just added. I am using a sql statement to get the data.

Here is the original sql:
SQL = "Select orgn, name, case when name is null then cast(cnt
as char(4)) else ' ' end as cnt " & _
"From (Select orgn, name, count(*) cnt " & _
"From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2)
as orgn, '[' || CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' || " & _
"VLTM.LAST_NAME || ', '
|| VLTM.FIRST_NAME || ' ' || VLTM.MIDDLE_INITIAL name " & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT,
V_LEAN_TEAM_MEMBER VLTM " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
_
Session("ReportSelectionEndDate") & "' AND
VLTM.UNIVERSAL_ID IN (" & _
"Select UNIVERSAL_ID " & _
"From (Select vltm2.UNIVERSAL_ID, count(*)
" & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM
VLT, V_LEAN_TEAM_MEMBER VLTM2 " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
Session("ReportSelectionEndDate") & "' " & _
"AND VLE.EVENT_ID =
VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID " & _
"Group By vltm2.UNIVERSAL_ID Having count(*) >= 1
Order By vltm2.UNIVERSAL_ID))) " & _
"GROUP BY ROLLUP (orgn, (name))) Order By orgn, name"
Here is the new sql, I added event type field:
Select orgn, name, etype, case when name is null then cast(cnt as char(4))
else ' ' end as cnt
From (Select orgn, name, etype, count(*) cnt
From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2) as orgn, '[' ||
CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' ||
VLTM.LAST_NAME || ', ' || VLTM.FIRST_NAME || ' ' ||
VLTM.MIDDLE_INITIAL NAME,
VLE.EVENT_TYPE etype
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000' AND
'31-DEC-2099' AND VLTM.UNIVERSAL_ID IN
(Select UNIVERSAL_ID
From
(Select vltm2.UNIVERSAL_ID, count(*)
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM2
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000'
AND '31-DEC-2099' AND
VLE.EVENT_ID = VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID
Group By vltm2.UNIVERSAL_ID Having count(*) >= 1 Order By
vltm2.UNIVERSAL_ID)))
GROUP BY ROLLUP (orgn, name, etype))
Order By orgn, name

I have run the new sql statement in TOAD and the field data shows up, it
doesn't show up when I execute in my app.
Sep 29 '06 #1
1 1417
All set, I changed the Group By Rollup to GROUP BY ROLLUP (orgn, (name,
etype)) and it works. My sql skills is still newbie-ish.

"jfarias" wrote:
Hello all,
The problem I am having is in one of the datagrids I added a new column.
When I run the application data is not shown in the new column. I am using
VS.NET 2003 and am connecting to a sql database(Oracle 10g). Before adding
the new column the other fields show up. The other fields still show up but
not the one I had just added. I am using a sql statement to get the data.

Here is the original sql:
SQL = "Select orgn, name, case when name is null then cast(cnt
as char(4)) else ' ' end as cnt " & _
"From (Select orgn, name, count(*) cnt " & _
"From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2)
as orgn, '[' || CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' || " & _
"VLTM.LAST_NAME || ', '
|| VLTM.FIRST_NAME || ' ' || VLTM.MIDDLE_INITIAL name " & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT,
V_LEAN_TEAM_MEMBER VLTM " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
_
Session("ReportSelectionEndDate") & "' AND
VLTM.UNIVERSAL_ID IN (" & _
"Select UNIVERSAL_ID " & _
"From (Select vltm2.UNIVERSAL_ID, count(*)
" & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM
VLT, V_LEAN_TEAM_MEMBER VLTM2 " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
Session("ReportSelectionEndDate") & "' " & _
"AND VLE.EVENT_ID =
VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID " & _
"Group By vltm2.UNIVERSAL_ID Having count(*) >= 1
Order By vltm2.UNIVERSAL_ID))) " & _
"GROUP BY ROLLUP (orgn, (name))) Order By orgn, name"
Here is the new sql, I added event type field:
Select orgn, name, etype, case when name is null then cast(cnt as char(4))
else ' ' end as cnt
From (Select orgn, name, etype, count(*) cnt
From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2) as orgn, '[' ||
CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' ||
VLTM.LAST_NAME || ', ' || VLTM.FIRST_NAME || ' ' ||
VLTM.MIDDLE_INITIAL NAME,
VLE.EVENT_TYPE etype
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000' AND
'31-DEC-2099' AND VLTM.UNIVERSAL_ID IN
(Select UNIVERSAL_ID
From
(Select vltm2.UNIVERSAL_ID, count(*)
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM2
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000'
AND '31-DEC-2099' AND
VLE.EVENT_ID = VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID
Group By vltm2.UNIVERSAL_ID Having count(*) >= 1 Order By
vltm2.UNIVERSAL_ID)))
GROUP BY ROLLUP (orgn, name, etype))
Order By orgn, name

I have run the new sql statement in TOAD and the field data shows up, it
doesn't show up when I execute in my app.
Sep 29 '06 #2

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

Similar topics

1
by: Maziar Aflatoun | last post by:
Hi everyone, I have this DataGrid that I bind to a DataTable. However, instead of displaying the column 'Qty', I like to place it in a textbox and display the value of Qty as the default value...
3
by: Doug | last post by:
Hi I have the following code (not mine) that populates a datagrid with some file names. But I want to replace the datagrid with a combo box. private void OnCurrentDataCellChanged(object sender,...
5
by: AC | last post by:
Any reason i'm having trouble with: DataGrid1.Columns(7).ItemStyle.HorizontalAlign = HorizontalAlign.Right I'm trying to directly set the column alignment of a datagrid created at runtime.. ...
12
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
6
by: epigram | last post by:
I'm using the DataGrid with AutoGenerateColumns set to false and choosing which columns I want in the grid by using the <Columns> attribute. What I want to do is to create a hyperlink out of one...
4
by: Pacific Design Studios | last post by:
I have a DataGrid on Form1 that displays a small amount of information about employees. On Form2 I want to have all the data displaying in text boxes about the employee selected in the datagrid on...
7
by: Arpan | last post by:
Assume that a database table has the following 4 columns - ID, UserID, Subject & Marks. I am retrieving the records existing in this DB table & displaying them in a DataGrid like this: <script...
2
by: cj | last post by:
I was looking over some of my 2003 code today (see below) that loads a foxpro table via oledb connection. I used a sub "autosizecolumns" I found on the web but I never quite understood why they...
3
by: remya1000 | last post by:
I’m using Vb.net application program. I created a datagrid having text field and checkbox fields. Everything is displaying correctly. I have 9 Columns and each columns are equally separated. In...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.