|
Hi all,
I am about to develop a client server application in which there can be more than 2000 clients continuously using the application at once.
The rows returned at one time might be of 1000 s as well. Previously in VB 6 I use to use win sock or dart sock for communicating but the projects were not as big as this.
Now i am developing this application in .net 2005 and i went through web and found 3 different approaches of communicating between client and server applications and so I am not being able to choose the right one for me.
In my application i will have one desktop application and one web application. Both of these interfaces can be used by clients which connect to remote server and i need to log the connected users as well.
Then server will process the requests and talk to Active x objects which will be located in different remote location and those active x objects will talk to database and get back the rows and have to return to appropriate client.
Ok now in this scenario what would be better for me to use? please advice advantages and disadvantages of using each of the processes.
thanks in advance
|
|
|
|
|
I would probably use a web service. I beleive remoting will give you a faster response but the environment is more complex to maintain. I'll be interested in other responses.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello to all you gurus and supporters here!
I seem to create some performance trouble when it comes to reading the filenames from a large directory (~ 30 thousand files) into a listview field like that:
Dim TargetFileList As Array
With openDLG
...
If .ShowDialog = Windows.Forms.DialogResult.OK Then
TargetFileList = openDLG.FileNames
Return TargetFileList
End if
End With The applications dialog window freezes for long... long....
Does someone of you probably know a better (i.e. faster) way of reading all of these filenames? The purpose is to find similar names in another directory and display filesInDir1 / missing files / filesInDir2 in different listview fields then.
Thank you for any inspiration
Michael
|
|
|
|
|
There's no way to speed this up. You're already using the system supplied dialog. Really, the problem is in returning a list of 30,000+ filenames and rendering them in the dialog. You'll ahve to write your own, but I doubt you'll see any performance gains that would justify the effort.
|
|
|
|
|
Listview doesn't handle that much items very fast in normal mode. Have a look at ListView.VirtualMode Property[^]
The need to optimize rises from a bad design
|
|
|
|
|
Thank you both for examining.
I'll have a close look at the VirtualMode.
|
|
|
|
|
I had to do something similar to what your trying to accomplish. Basically I have a treeview that is being 'partially' built with dirs/filenames when the app loads. The app requirements were that some directories were to be selected by default meaning that the "parent" directory, sub dirs, and all files are to be selected. The user can also select just a dir or selected files (so I used a tri-state checkbox scheme with the grid lines).
If a parent is expanded, the files and dirs are then populated. If closed and checked, there's no need to pull the files since you're selecting everything unless the users expands the node (if this is making sense).
We have dirs with a very large amount of files per folder. Trying to pull all file names for all folders at once could be done. Had to split it out a little.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Smart idea, kissdnuts - guess you had some good coffee again ! I thought it might be the shorter and faster way to use standard windows dialogs, but it seems the standard dialog collects the files already when a folder has been selected (which doesn't make a lot of sense, does it?).
Would you be so kind as to put some example code for populating the tree view?
Thanks
Michael
|
|
|
|
|
Hi everybody,
gotta deal with directories containing large numbers of files (approx. 30.000 in each dir), so that directory selection seems to be an endless process ( pita ) for the user if I use the the VB 2008 (Express) FolderBrowserDialog object.
In an older VBScript solution I was able to integrate a text field into the shell.BrowseForFolder object (parameter), so that there was the option to type or paste a path alternatively. This option I can't find for the FolderBrowserDialog, nor can I find any information if (and if not: how?) it's possible to use the shell.BrowseForFolder in VB 2008.
Does someone of you know a nice & fast solution for selecting a folder containing so many files? I don't need any filenames here, just the path.
Thank you
Michael
|
|
|
|
|
I did something similar to what your doing. I used a treeview/listview with checkboxes so that the user could select directories etc dynamically.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
You can use the "FolderBrowserDialog" class in System.Windows.Forms.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Thank you both for inspiration. I'll check it out!
|
|
|
|
|
Thanks for your answer, but are there really different objects called "FolderBrowserDialog"?
I had used the one "FolderBrowserDialog" before, like
Dim openFLD As New FolderBrowserDialog and that's the one that takes endless time and makes the application freeze with a large file number.
In case there are different objects of the same name: HOW would I tell VB which one to use?
Regards
Michael
|
|
|
|
|
I've added a binary file to my project as a resource, and set it's Build Action to Embedded Resource. How can I read the data and save it into an output file when the user clicks a button?
modified on Thursday, October 9, 2008 2:36 PM
|
|
|
|
|
Which version of .NET or Visual Studio are you using?? If using .NET 2.0 or Visual Studio 2005 or above, it's easy.
Dim fs As New FileStream(pathToFileToWrite, FileMode.Create, FileAccess.Write, FileShare.None)
fs.Write(My.Resources.resourceName, 0, My.Resources.resourceName.Length)
fs.Close()
|
|
|
|
|
Hi all...
I am getting problem while searching records in a given range of dates.
I used following codes to search a single record,
where con is connection name and date is stored in a textbox named txtdate.
dim sql as string="Select name from emp where date like '" & txtdate.text & "'"
dim cmd as new oledb.oledbcommand(sql,con)
dim reader as oledb.oledb.datareader=cmd.executereader
while reader.read
'code is here
wnd while
reader.close
This only gives records for a single date.
What should I write to get records in a given range of dates like records between dates 06/05/08 to 06/06/08
Gagan
|
|
|
|
|
Freehand, but you get the jist.
Select name from emp where date >= 'Date1Value and date <= 'date2value'
or
Select name from emp where date between 'datevalue1' and 'datevalue2'
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Gagan.20 wrote: dim sql as string="Select name from emp where date like '" & txtdate.text & "'"
Word of advise, string concatenation in a query like this, opens you up to SQL Injection attacks.
"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
|
|
|
|
|
I have an app that has a reference to MS Excel 9.0. Below is a generic snippet that can be used to verify the condition.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oExcel As Excel.Application = Nothing
oExcel = New Excel.Application
oExcel.Workbooks.Open(Filename:="C:\0000.xls")
oExcel = Nothing
End Sub
The referenced file from what I can tell is EXCEL9.OLB. On my dev box 2 interop dlls are created: Interop.Excel.dll and Interop.Microsoft.Office.Core.dll (not sure what this file correlates to?) and the copy local property is true.
The app works fine on my dev box. I attempt to copy my release folder and c:\win\sys32\EXCEL9.OLB files to the same directories on a test box, along with C:\0000.xls. The application errors off with "System.Runtime.InteropServices.COMException".
Is there something I am missing to deploy an interop app that is using an office reference (specifically to version 9.0)? Thanks for any pointers - having a hard time with this.
I have also tried using TLBIMP with EXCEL9.OLB and then referencing the Excel.dll and Office.dll generated, but the same errors occur.
Additional edits:
I have Office XP installed but have the Excel9.olb file in my sys32 directory. I tried these recommendations:
Achieving Backward Compatibility with .NET Interop: Excel as Case Study
Creating an Excel Spreadsheet programmatically using VB.NET
Same problem.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
modified on Thursday, October 9, 2008 3:08 PM
|
|
|
|
|
If I install excel on the test machine, everything is fine.
Any idea what files need to be redistributed?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
The entire installation of Excel is the only licensed method. AFAIK, there is no licensed "partial" installation.
|
|
|
|
|
Roger that Dave.
Thanks!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi
Does anyone know of a better quick way to copy directories/files in VB.net than using
[code]
Computer.FileSystem.CopyFile
[/code]
The reason is because I’m developing a system that copies files/directories from one or multiple location to one location, to do this I use the below function
[code]
Public Sub copyDirectory(ByVal strtoROOTlocation As String, ByVal strrootfromName As String, ByVal root As DirectoryInfo, ByVal intIndex As Integer, ByVal video As Boolean)
Dim strfromDirectoryFullPath As String = root.FullName
Dim strtoDrectoryName As String
Dim blcopy As Boolean
If intIndex = 0 Then
strtoDrectoryName = ""
Else
strtoDrectoryName = "\" + root.Name
End If
For Each fiifiles As FileInfo In root.GetFiles
If blcopy Then
'This will stop Un needed files being copied
If Not fiifiles.Extension = ".doc" And Not fiifiles.Extension = ".fla" And Not fiifiles.Extension = ".db" Then
My.Computer.FileSystem.CopyFile(strfromDirectoryFullPath + "\" + fiifiles.Name, strtoROOTlocation + "\" + strtoDrectoryName + "\" + fiifiles.Name, True)
'frmmain.build.BackgroundWorker1.ReportProgress("********" + fiifiles.Name, "full")
Else
End If
End If 'END IF (blcopy Second Level)
Next ' END Root Folder - Content Loop
Else
End If 'END IF (NO video)
For Each driirectory As DirectoryInfo In root.GetDirectories
copyDirectory(strtoROOTlocation + "\" + strtoDrectoryName, strtoROOTlocation + "\" + strtoDrectoryName, driirectory, intIndex + 1, video)
Next ' END Root Folder - Content Loop
End Sub
[/code]
This seems fine until it starts copying large files…
Does anyone know of a better way that I could increase the speed of copying large files..
Thanks
|
|
|
|
|
Your only option is to farm out the actualy copying of files to the Shell. This is as fast as it's going to get. But don't expect huge gains in performance. You can find examples here[^].
|
|
|
|
|
Had a quick look at this and it seems good, but it always ask if i want to create a directory files if there is nothing there..
Do you know quickly if there is a way of telling it not to ask and create the directory automatically?
Thanks
|
|
|
|