Click here to Skip to main content
16,020,622 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: hInstance difference between WNDCLASS and CreatWindow Pin
led mike22-Jun-09 4:55
led mike22-Jun-09 4:55 
GeneralRe: hInstance difference between WNDCLASS and CreatWindow Pin
iceman861622-Jun-09 16:01
iceman861622-Jun-09 16:01 
GeneralRe: hInstance difference between WNDCLASS and CreatWindow Pin
led mike23-Jun-09 4:40
led mike23-Jun-09 4:40 
Question[Solved] VS 2010 : TableLayoutPanel does NOT expose RowSpan and ColumnSpan properties at design-time [modified] Pin
BillWoodruff17-Jun-09 23:19
professionalBillWoodruff17-Jun-09 23:19 
AnswerRe: VS 2010 : TableLayoutPanel does NOT expose RowSpan and ColumnSpan properties at design-time Pin
led mike18-Jun-09 4:43
led mike18-Jun-09 4:43 
QuestionSQL query worked fine... until I tried it in Visual Studio 2008 Pin
Andrew Tamberino17-Jun-09 9:12
Andrew Tamberino17-Jun-09 9:12 
AnswerRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Dave Kreskowiak17-Jun-09 10:19
mveDave Kreskowiak17-Jun-09 10:19 
GeneralRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Andrew Tamberino17-Jun-09 11:07
Andrew Tamberino17-Jun-09 11:07 
I'm sorry if I spoke without precision - the query I posted worked when I tried it with SQL management studio, run against a sample database. The error shown was thrown when I wrote that exact query code into the DataTable Adaptor in Visual Studio 2008 as a query to the ODBC Text Driver Connected text file. "DSN = SampleFile.txt" is the connection string. I could post the whole path, but it would be meaningless, as it is specific to my machine.
My complete effort is detailed here:

Copy the text to a file called "SampleFile.txt" in a selected directory.

Edit the schema.ini file of that directory as follows:

[samplefile.txt]
ColNameHeader=False
Format=FixedLength
MaxScanRows=25
CharacterSet=OEM
Col1=NAME Char Width 8
Col2=TIME Integer Width 8
Col3=AGE Integer Width 8

Under the Data Sources (ODBC) section of the administrative tools file in control panel, set
"SampleFile.txt" to be a Microsoft Text Driver (*.txt; *.csv) System Data Source.

In Visual Studio 2008 create a new project using the windows application template.
Place a datagridview in the form.

Create a Data table, using the following SQL query:

SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE < 16
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE BETWEEN 16 AND 29
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE > 29
ORDER BY TIME

Here is where it failed. I'm trying to rank 3 age group result sets and then output all three into one datagridview.

I was using the approach wherein I wrote 3 queries into 3 datatables, created a column I called ranking and then set it to auto-increment, seed=1, step=1, but then I couldn't get the 3 resulting datatables to bind back to the 1 datagridview, so I've been battling with this one query linked with the UNION clause.

Thanks for your help,
Andrew
GeneralRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Dave Kreskowiak17-Jun-09 13:33
mveDave Kreskowiak17-Jun-09 13:33 
GeneralRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Andrew Tamberino17-Jun-09 14:23
Andrew Tamberino17-Jun-09 14:23 
GeneralRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Dave Kreskowiak17-Jun-09 18:03
mveDave Kreskowiak17-Jun-09 18:03 
GeneralRe: SQL query worked fine... until I tried it in Visual Studio 2008 Pin
Andrew Tamberino18-Jun-09 9:54
Andrew Tamberino18-Jun-09 9:54 
Questionhow do i use textbox value from one form on another to access database without releasing the resource(value) Pin
ChiSmile17-Jun-09 7:35
ChiSmile17-Jun-09 7:35 
QuestionPropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
BillWoodruff17-Jun-09 3:00
professionalBillWoodruff17-Jun-09 3:00 
AnswerRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
led mike17-Jun-09 4:40
led mike17-Jun-09 4:40 
GeneralRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
BillWoodruff17-Jun-09 5:07
professionalBillWoodruff17-Jun-09 5:07 
GeneralRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
led mike17-Jun-09 5:48
led mike17-Jun-09 5:48 
GeneralRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
BillWoodruff17-Jun-09 6:02
professionalBillWoodruff17-Jun-09 6:02 
GeneralRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
DaveyM6917-Jun-09 6:11
professionalDaveyM6917-Jun-09 6:11 
GeneralRe: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
led mike17-Jun-09 6:20
led mike17-Jun-09 6:20 
Generalto Led Mike and DaveyM69 : Re: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
BillWoodruff17-Jun-09 11:06
professionalBillWoodruff17-Jun-09 11:06 
GeneralRe: to Led Mike and DaveyM69 : Re: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
Scott Dorman17-Jun-09 12:57
professionalScott Dorman17-Jun-09 12:57 
GeneralRe: to Led Mike and DaveyM69 : Re: PropertyGrid control slow to load because it automatically "reflects" on all controls in current application ? Pin
BillWoodruff17-Jun-09 19:54
professionalBillWoodruff17-Jun-09 19:54 
QuestionHow to hook up a VScrollBar to a control? Pin
Alan Burkhart16-Jun-09 19:00
Alan Burkhart16-Jun-09 19:00 
AnswerRe: How to hook up a VScrollBar to a control? Pin
Eslam Afifi17-Jun-09 1:03
Eslam Afifi17-Jun-09 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.