Click here to Skip to main content
15,895,740 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan9-Jan-11 2:38
TheComputerMan9-Jan-11 2:38 
GeneralRe: Strange SQL Compact Problem - Vista Pin
Richard MacCutchan9-Jan-11 4:21
mveRichard MacCutchan9-Jan-11 4:21 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan9-Jan-11 5:02
TheComputerMan9-Jan-11 5:02 
AnswerRe: Strange SQL Compact Problem - Vista Pin
Dave Kreskowiak8-Jan-11 4:25
mveDave Kreskowiak8-Jan-11 4:25 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan8-Jan-11 16:30
TheComputerMan8-Jan-11 16:30 
AnswerRe: Strange SQL Compact Problem - Vista Pin
Luc Pattyn8-Jan-11 16:35
sitebuilderLuc Pattyn8-Jan-11 16:35 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan9-Jan-11 2:01
TheComputerMan9-Jan-11 2:01 
GeneralRe: Strange SQL Compact Problem - Vista Pin
Dave Kreskowiak8-Jan-11 18:22
mveDave Kreskowiak8-Jan-11 18:22 
TheComputerMan wrote:
it might be a bad idea from a security aspect


No, it's a bad idea from an SQL standpoint. Your code can't tell which columns it's getting back until it examines the columns themselves. Right now, your code is ASSUMING it's getting back 5 columns when, in fact, it's only getting 4. There is no difference between the XP and Vista versions, other than your code is obviously hitting the wrong database.

If you change the schema of the database, you also change the number of columns you get back and also the order in which the columns arrive in your code. Since your code is assuming it's getting back certain columns in certain index positions, just making one change to the database may alter that order and totally screw up your code. You always specify the columns you want in the SQL and you access those columns in the returned dataset/reader/whatever with named indexes (using strings, not numbers) so you know your always getting the correct columns, no matter which order they get returned to you.

GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan9-Jan-11 1:58
TheComputerMan9-Jan-11 1:58 
GeneralRe: Strange SQL Compact Problem - Vista Pin
Dave Kreskowiak9-Jan-11 3:36
mveDave Kreskowiak9-Jan-11 3:36 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan9-Jan-11 3:45
TheComputerMan9-Jan-11 3:45 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan14-Jan-11 11:16
TheComputerMan14-Jan-11 11:16 
GeneralRe: Strange SQL Compact Problem - Vista Pin
Dave Kreskowiak14-Jan-11 12:16
mveDave Kreskowiak14-Jan-11 12:16 
GeneralRe: Strange SQL Compact Problem - Vista Pin
TheComputerMan14-Jan-11 12:19
TheComputerMan14-Jan-11 12:19 
QuestionVB.Net and printer properties Pin
directred7-Jan-11 4:53
directred7-Jan-11 4:53 
AnswerRe: VB.Net and printer properties Pin
Luc Pattyn7-Jan-11 5:05
sitebuilderLuc Pattyn7-Jan-11 5:05 
AnswerRe: VB.Net and printer properties Pin
Abhinav S9-Jan-11 23:45
Abhinav S9-Jan-11 23:45 
QuestionIntroduction to Visual Basic .NET Pin
cool136-Jan-11 8:39
cool136-Jan-11 8:39 
AnswerRe: Introduction to Visual Basic .NET Pin
Dave Kreskowiak6-Jan-11 9:59
mveDave Kreskowiak6-Jan-11 9:59 
AnswerRe: Introduction to Visual Basic .NET Pin
_Erik_7-Jan-11 4:25
_Erik_7-Jan-11 4:25 
GeneralRe: Introduction to Visual Basic .NET Pin
Dalek Dave7-Jan-11 4:34
professionalDalek Dave7-Jan-11 4:34 
QuestionMessage Removed Pin
5-Jan-11 22:33
lucky_12215-Jan-11 22:33 
AnswerRe: installshield Pin
Dave Kreskowiak6-Jan-11 9:58
mveDave Kreskowiak6-Jan-11 9:58 
QuestionNeed to search for code (2.02)? Pin
waner michaud5-Jan-11 5:27
waner michaud5-Jan-11 5:27 
AnswerRe: Need to search for code (2.02)? Pin
Luc Pattyn5-Jan-11 5:41
sitebuilderLuc Pattyn5-Jan-11 5:41 

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.