|
Well, i'd like to know what's the best way of saving that list of products including special characters
Motivation is the key to software development.
|
|
|
|
|
Depending on the volume/number of users I would use either sql server or sql server express. In either case nvarchar is the datatype you require.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
SQL, MSAccess, Oracle
Personally i would either use Microsoft Access or create a new file format for my purposes.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hello everybody,
being rather new to VB.NET (VS 2008 Express) I have to admit that I study much more than producing results. So first of all: Thank you everybody in here for an invaluable source of inspiration, which is highly appreciated!
One of the little tools I'm playing around with is just listing the number of files in all the directories / subdirectories of a selected Path. Since a path might contain several folders with approx. 30.000 larger files (8 MB each), I'm a bit worried about performance and would like to ask for review and advice:
- I'm using two backgroundworkers, the first of which is intended to proceed a total files count (incl. all the subdirs in the path) in order to set the maximum for a progress indicator:
total = My.Computer.FileSystem.GetFiles(PathName, FileIO.SearchOption.SearchAllSubDirectories).Count
- the second BW calls the function "zählung" which loops through the subdirs and updates the progress indicater through the _ProgressChanged event:
Private Sub Zählung(ByVal obj As String)<br />
Dim subfolders As System.Collections.ObjectModel.ReadOnlyCollection(Of String)<br />
Dim files As System.Collections.ObjectModel.ReadOnlyCollection(Of String)<br />
<br />
On Error Resume Next<br />
Me.Refresh()<br />
If BackgroundWorker2.CancellationPending Then Exit Sub<br />
<br />
If InStr(1, obj, "RECYCLER") > 0 Or InStr(1, obj, "System") > 0 Then<br />
'MsgBox(obj & " ist ein Systemordner", , USRINFO)<br />
Else<br />
If My.Computer.FileSystem.FileExists(obj & "\" & "Thumbs.db") Then<br />
My.Computer.FileSystem.DeleteFile(obj & "\" & "Thumbs.db")<br />
'MsgBox("Thumbs im Verzeichnis " & Pfad & " gelöscht!", MsgBoxStyle.Information, USRINFO)<br />
End If<br />
<br />
subfolders = My.Computer.FileSystem.GetDirectories(obj)<br />
files = My.Computer.FileSystem.GetFiles(obj, FileIO.SearchOption.SearchTopLevelOnly)<br />
ordner = ordner + subfolders.Count<br />
dateien = dateien + files.Count<br />
<br />
If total = Nothing Then<br />
'initially the progress indicator style has been set to marquee<br />
BackgroundWorker2.ReportProgress(dateien * 100 / dateien, obj)<br />
Else<br />
'progress indicator style has been set to continuous before, when BW1 is finished<br />
BackgroundWorker2.ReportProgress(dateien * 100 / total, obj)<br />
End If<br />
<br />
For Each unterordner As String In subfolders<br />
Zählung(unterordner)<br />
Next<br />
End If
During above function (i.e. ReportProgress) each path is also shown in a form label, and an additional timer-label (showing the time elapsed) is updated. How can I limit these updates to e.g. once per second?
After reading e.g. about "virtual listview" control, I really doubt that my methods are performing the best way they could. Would you be so kind and let me know any better performing ways?
Thank you very much
and have a nice day
Michael
|
|
|
|
|
Michael Schäuble wrote: total = My.Computer.FileSystem.GetFiles(PathName, FileIO.SearchOption.SearchAllSubDirectories).Count
That will create a list of strings that you just throw away, as you only use the size of the list. You should implement a method that loops the folders and counts the files, so that you don't create that huge list just to throw away.
Michael Schäuble wrote: During above function (i.e. ReportProgress) each path is also shown in a form label, and an additional timer-label (showing the time elapsed) is updated. How can I limit these updates to e.g. once per second?
Store the path in a variable, and use a timer to once a second put the current path and the elapsed time in the labels.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you, Guffa. Seems like I can really increase performance...
Which method would you think of? I'm pretty new to VB 2008 and didn't find any other method how to count the files yet, than listing their names and counting the number of names afterwards...
Regarding your 2nd hint: The path is stored in a variable (string), but the BackgroundWorker is called within every loop of the function and updates the labels. Which commands or structure would I need to limit that to once a second? How would I express something like "if now() = LastLabelUpdate + 1 then BGWorker.update" or so...??
|
|
|
|
|
Michael Schäuble wrote: Which method would you think of? I'm pretty new to VB 2008 and didn't find any other method how to count the files yet, than listing their names and counting the number of names afterwards...
You use the same method, but you don't tell it to look in all sub folders. Instead you look in the sub folders yourself and count the files. That way each list you get only contains the files in a single folder. You will use the same amount of memory, but not at the same time. A lot of small objects are cheaper than a few huge objects, especially as the small objects are quite short lived.
Michael Schäuble wrote: The path is stored in a variable (string), but the BackgroundWorker is called within every loop of the function and updates the labels. Which commands or structure would I need to limit that to once a second? How would I express something like "if now() = LastLabelUpdate + 1 then BGWorker.update" or so...??
You either use a timer set to elapse once a second, or you store the time of the next update (DateTime.UtcNow.AddSeconds(1) ) in a variable so that you can compare it to the current time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Full House, Guffa
I guess you helped me understand the details of what I'm doing a bit more ... highly appreciated!
Michael
|
|
|
|
|
Hi All!
In my project, I need a solution explorer control but I can't seem to find a nice ready-made solution explorer or any information on how the visual studio solution explorer works that I would need to make my own. Does anybody have any ideas?
Thanks!
MrWolfy
|
|
|
|
|
Hi all...
I wanna draw a transparent/colorful bitmap on my form using graphics
Could anyone tell me the procedure???
|
|
|
|
|
make a transparency mask by drawing your transparent area an unused color, then use the ImageAttributes class to specify what color to draw transparently.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Thnx for ur suggestion The JZ but I have already tried it.
I want to create a top-most window so that before closing the window,one can not use or access data from previous window..
Help me...
Gagan
|
|
|
|
|
don't post like this, post in the thread, no-one knows what the previous suggestion was. I assume it was to set the window to be topmost, that is your only option. And yes, it works just fine.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
isn't just form.ShowDialog()?
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
I want to create a top-most window.
If a window will appear then before entering or canceling data user can't perform any other operation.
Help me...
|
|
|
|
|
|
Thnx for ur suggestion The JZ but I have tried it.
I want to create a top-most window so that before closing the window,one can not use or access data from previous window..
Help me...
Gagan
|
|
|
|
|
Gagan.20 wrote: Thnx for ur suggestion The JZ but I have tried it.
Apparently you haven't, because not only does it work, but it's the ONLY thing that works. What makes you think it doesn't work ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi!
Hmmm... I think I know what you mean. Try using ShowDialog() instead of Show() when you are opening your window in your code. That Should work.
Forgive me if I misunderstood your question.
Thanks!
MrWolfy
|
|
|
|
|
As suggested by The JZ, use the TopMost property.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
What is the use of .cab files?
How to add these .cab files in deployement projects and how to extract files stored in the .cab files?
Someome help me...
|
|
|
|
|
Gagan.20 wrote: What is the use of .cab files?
How to add these .cab files in deployement projects and how to extract files stored in the .cab files?
Someome help me...
This page should help you[^]
|
|
|
|
|
Hi ,
at runtime i want to add a new row and from the datatable i want to put those values
in to the grid .
In datatabel i have 1 ,2,3,4 i have to make changes to these no.s and assign YES NO like that .
How can i do these things??
|
|
|
|
|
VB 8.0 wrote: how to add a new row to datagridview at runtime.
use Datagridview1.rows.add() statement for add a row
VB 8.0 wrote: In datatabel i have 1 ,2,3,4 i have to make changes to these no.s and assign YES NO like that .
explain this in detail. so we can properly understand your problem and suggest you
|
|
|
|
|
I am Using Vb.net 3.5 as Frontend
I am creating a Windows Application.
I am Using a thread 'ThradSend' that do some work, I am starting thread as 'ThreadSend.Start()' and ending the thread ThreadSend.Abort()
It will work fine in my application but Throws an exception that 'Thread was being aborted. at System.Windows.Forms.dll ...'
This will no hampered my code but still a error a message displayed.
How can I Stop this Problem Or How can I Stop a running Tread . I can't use Thread.suspend() because it says Obsolute.....
AB
|
|
|
|