Click here to Skip to main content
15,889,200 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionKeep images to be open only by my program Pin
desanti5-Aug-16 10:23
desanti5-Aug-16 10:23 
AnswerRe: Keep images to be open only by my program Pin
Dave Kreskowiak5-Aug-16 10:43
mveDave Kreskowiak5-Aug-16 10:43 
GeneralRe: Keep images to be open only by my program Pin
desanti5-Aug-16 12:47
desanti5-Aug-16 12:47 
GeneralRe: Keep images to be open only by my program Pin
Eddy Vluggen5-Aug-16 12:59
professionalEddy Vluggen5-Aug-16 12:59 
GeneralRe: Keep images to be open only by my program Pin
desanti5-Aug-16 14:00
desanti5-Aug-16 14:00 
GeneralRe: Keep images to be open only by my program Pin
Dave Kreskowiak5-Aug-16 13:15
mveDave Kreskowiak5-Aug-16 13:15 
Questionvb.net 2010 that uses sql Pin
dcof5-Aug-16 6:04
dcof5-Aug-16 6:04 
AnswerRe: vb.net 2010 that uses sql Pin
Richard Deeming5-Aug-16 7:12
mveRichard Deeming5-Aug-16 7:12 
Assuming you want the comments in VB, and not in the actual query:
  • you can't put the comment before the line continuation character, because that comments out the line continuation character:
    & " WHERE cs.attributeID = 2775 " ' A comment _
  • you can't put the comment after the line continuation character, because the line continuation character has to be the last character on the line:
    & " WHERE cs.attributeID = 2775 " _ ' A comment

However, if you're using Visual Studio 2010 or later, you don't actually need the line continuation character. You just need to move the & from the start of the line to the end of the previous line:
VB.NET
Const sql As String = "SELECT CS2775.Personid,SchoolYearValue,SchoolYearName,CS2775.StatusDateTime " &
" from " &
"(SELECT cs.Personid,cs.value as SchoolYearValue, cd.name as SchoolYearName , [date] AS StatusDateTime " &
" FROM TEST.DBO.customstudent cs WITH (NOLOCK)" &
" JOIN TEST.DBO.CampusDictiONary cd " &
" ON cs.attributeid = cd.attributeID AND cs.value =cd.code" &
" WHERE cs.attributeID = 2775 " & ' A comment
" GROUP BY personID, cs.value, cd.value,name,[date]) as CS2775 " &
" LEFT JOIN (SELECT Personid,value as Edcounsel1CP, max([date]) AS StatusDateTime " &
" FROM TEST.DBO.customstudent WITH (NOLOCK)" &
" WHERE attributeID = 2771 " & ' Another comment
" GROUP BY personID, value ) as CS2771 " &
" ON CS2771.PersonID = CS2775.Personid " &
" AND CS2771.StatusDateTime = CS2775.StatusDateTime " &
" WHERE CS2775.Personid = @studentlink ; "



If you do want the comments to be part of the query, then you'll need to use SQL's multi-line comment syntax:
VB.NET
& " WHERE cs.attributeID = 2775 /* A comment */ " _

You can't use the single-line comment syntax, because your query is all on one line, and everything after the comment would also be commented out.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: vb.net 2010 that uses sql Pin
dcof7-Aug-16 9:19
dcof7-Aug-16 9:19 
Question.NET - Acrobat 11 crashes when opening PDF Pin
vaultboy4-Aug-16 7:16
vaultboy4-Aug-16 7:16 
Questionvisual basic in powerpoint Pin
Member 126697404-Aug-16 1:01
Member 126697404-Aug-16 1:01 
QuestionRe: visual basic in powerpoint Pin
Richard MacCutchan4-Aug-16 1:19
mveRichard MacCutchan4-Aug-16 1:19 
QuestionRuntime add com library reference Pin
BobbyStrain24-Jul-16 8:23
BobbyStrain24-Jul-16 8:23 
QuestionDisplay network signal strength (windows form app) Pin
dell-gl62m23-Jul-16 3:11
dell-gl62m23-Jul-16 3:11 
AnswerRe: Display network signal strength (windows form app) Pin
Richard MacCutchan23-Jul-16 4:09
mveRichard MacCutchan23-Jul-16 4:09 
GeneralRe: Display network signal strength (windows form app) Pin
dell-gl62m23-Jul-16 5:32
dell-gl62m23-Jul-16 5:32 
GeneralRe: Display network signal strength (windows form app) Pin
Richard MacCutchan23-Jul-16 5:44
mveRichard MacCutchan23-Jul-16 5:44 
GeneralRe: Display network signal strength (windows form app) Pin
dell-gl62m23-Jul-16 5:53
dell-gl62m23-Jul-16 5:53 
QuestionExtracting Outlook messages metadata to an Excel spreadsheet Pin
Alex911010-Jul-16 23:01
Alex911010-Jul-16 23:01 
AnswerRe: Extracting Outlook messages metadata to an Excel spreadsheet Pin
Alex911010-Jul-16 23:58
Alex911010-Jul-16 23:58 
QuestionRe: Extracting Outlook messages metadata to an Excel spreadsheet Pin
Richard MacCutchan11-Jul-16 2:04
mveRichard MacCutchan11-Jul-16 2:04 
AnswerRe: Extracting Outlook messages metadata to an Excel spreadsheet Pin
Alex911011-Jul-16 2:20
Alex911011-Jul-16 2:20 
GeneralRe: Extracting Outlook messages metadata to an Excel spreadsheet Pin
Richard MacCutchan11-Jul-16 2:31
mveRichard MacCutchan11-Jul-16 2:31 
GeneralRe: Extracting Outlook messages metadata to an Excel spreadsheet Pin
Alex911011-Jul-16 3:05
Alex911011-Jul-16 3:05 
QuestionVb Image scaling Pin
Otekpo Emmanuel6-Jul-16 9:32
Otekpo Emmanuel6-Jul-16 9:32 

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.