Click here to Skip to main content
15,900,108 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questioncrystal report with vb.net and sql server database Pin
tonifirnandes12-Mar-13 20:29
tonifirnandes12-Mar-13 20:29 
AnswerRe: crystal report with vb.net and sql server database Pin
Dave Kreskowiak13-Mar-13 1:13
mveDave Kreskowiak13-Mar-13 1:13 
QuestionHow to disable keyboard input, but keep USB-scanner input in a textbox? Pin
Martijnn12-Mar-13 3:55
Martijnn12-Mar-13 3:55 
AnswerRe: How to disable keyboard input, but keep USB-scanner input in a textbox? Pin
David Mujica12-Mar-13 4:46
David Mujica12-Mar-13 4:46 
GeneralRe: How to disable keyboard input, but keep USB-scanner input in a textbox? Pin
Martijnn12-Mar-13 4:53
Martijnn12-Mar-13 4:53 
GeneralRe: How to disable keyboard input, but keep USB-scanner input in a textbox? Pin
Bernhard Hiller12-Mar-13 5:07
Bernhard Hiller12-Mar-13 5:07 
GeneralRe: How to disable keyboard input, but keep USB-scanner input in a textbox? Pin
Martijnn12-Mar-13 5:18
Martijnn12-Mar-13 5:18 
QuestionClass Losing Data? [Solved] Pin
Member 990376112-Mar-13 0:26
Member 990376112-Mar-13 0:26 
Hi all. Im having a problem with losing data in a class but im unsure as to exactly how its happening. I post here an example of the parts of the code i am using that are causing a problem with an explanation of where i am seeing the problem(s) and hopefully someone will be able to point out what i am doing wrong.

VB
line 1	public ndlist as list (of data)		
line 2	public dylist as list (of days)		
line 3	'------------------------		
line 4			
line 5	public sub main_routine()		
line 6			
line 7	ndlist = new list (of data)		
line 8	dylist = new list (of days)		
line 9			
line 10	for a = 1 to something		
line 11		do	
line 12			
line 13			ndlist.add(new data("blahblah"))
line 14			' do something to ndlist
line 15			
line 16		loop until something	
line 17			
line 18		dylist.add(new days(a,b,ndlist))	
line 19		ndlist.clear	
line 20			
line 21	next a		
line 22			
line 23	for each dy as days in dylist		
line 24		' do something else	
line 25	next		
line 26			
line 27	end sub		
line 28			
line 29			
line 30	'---------------		
line 31	'For reference		
line 32			
line 33	public class days		
line 34			
line 35		public day_data as list(of data)	
line 36			
line 37		public sub new(byval a as integer, byval b as integer,byval ddata as list(of data))	
line 38			
line 39		day_data = ddata	
line 40			
line 41		end sub	
line 42			
line 43	end class		
line 44			
line 45	public class data		
line 46			
line 47		public rwdata(1500)	
line 48		public id as string	
line 49			
line 50		public sub new(byval str as string)	
line 51			
line 52		id = str	
line 53			
line 54		end sub	
line 55			
line 56	end class


So you can see basically i have a list of days containing a list of data for each day. I use the data class in lists elsewhere in the project and thought it would be easier to re-use it for the day class. What i am seeing is between lines 10 and 21 the program operates normally. If i insert a breakpoint in vs2010 on line 18 i can watch the dylist add items to its collection and when i drill down the elements of the collections i can see the data where i expect it to be. For reference the data is at

dylist.item(x).day_data.item(y).rwdata(z)

The problem comes when i exit the for/next loop for further processing. When i get to line 23 and i access

dy.item(x).day_data.item(y).rwdata(z)

it contains nothing as do all the the other elements in the dylist collection and i have no idea why?

The code runs all at once and there is no background threads or anything else happening in the background when i run the code. I am firing it off a button just now for testing.

Any ideas?


btw - great website! i use this all the time for little snippets of info for my coding but have never had to resort to posting here yet. Thanks for all the help ive utilised from your site so far Big Grin | :-D

modified 12-Mar-13 9:09am.

AnswerRe: Class Losing Data? Pin
GuyThiebaut12-Mar-13 2:55
professionalGuyThiebaut12-Mar-13 2:55 
GeneralRe: Class Losing Data? Pin
Member 990376112-Mar-13 3:09
Member 990376112-Mar-13 3:09 
QuestionVB.Net & 7-Zip File Manager Pin
Central_IT11-Mar-13 4:43
Central_IT11-Mar-13 4:43 
AnswerRe: VB.Net & 7-Zip File Manager Pin
David Mujica11-Mar-13 5:26
David Mujica11-Mar-13 5:26 
GeneralRe: VB.Net & 7-Zip File Manager Pin
Central_IT11-Mar-13 23:07
Central_IT11-Mar-13 23:07 
AnswerRe: VB.Net & 7-Zip File Manager Pin
Richard Deeming11-Mar-13 6:40
mveRichard Deeming11-Mar-13 6:40 
GeneralRe: VB.Net & 7-Zip File Manager Pin
Central_IT11-Mar-13 23:06
Central_IT11-Mar-13 23:06 
Questionhi am bharat Pin
Member 989980611-Mar-13 3:25
Member 989980611-Mar-13 3:25 
AnswerRe: hi am bharat Pin
David Mujica11-Mar-13 3:52
David Mujica11-Mar-13 3:52 
AnswerRe: hi am bharat Pin
Eddy Vluggen11-Mar-13 3:59
professionalEddy Vluggen11-Mar-13 3:59 
QuestionMultiple MonthCalendars in a form - does not keep all dates in each textbox Pin
PrissySC10-Mar-13 0:54
PrissySC10-Mar-13 0:54 
AnswerRe: Multiple MonthCalendars in a form - does not keep all dates in each textbox Pin
Eddy Vluggen10-Mar-13 2:44
professionalEddy Vluggen10-Mar-13 2:44 
GeneralRe: Multiple MonthCalendars in a form - does not keep all dates in each textbox Pin
PrissySC13-Mar-13 8:01
PrissySC13-Mar-13 8:01 
QuestionCell grid can change color and down the line in the title ? Pin
Member 24584678-Mar-13 16:40
Member 24584678-Mar-13 16:40 
AnswerRe: Cell grid can change color and down the line in the title ? Pin
Dave Kreskowiak9-Mar-13 3:20
mveDave Kreskowiak9-Mar-13 3:20 
QuestionRemote Desktop Accessing Pin
PDBHONGAON7-Mar-13 1:04
PDBHONGAON7-Mar-13 1:04 
AnswerRe: Remote Desktop Accessing Pin
Richard MacCutchan7-Mar-13 1:38
mveRichard MacCutchan7-Mar-13 1:38 

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.