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. 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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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,...
|
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..
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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
|
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...
|
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...
| |