|
Phoenix Hawke wrote: I have a query that is returning 300K+ records
Nobody is going to look through 300,000 records for anything. On top of that, you're loading all of those into a DataTable, burning up network bandwidth transmitting all those records and burning up memory because you're storing them all in a DataTable.
Virtual mode is intended to give you an oportunity to retrieve only the visible subset of the larger recordset being viewed. For example, if your displayed grid is only 20 rows high, you can retrieve only the 20 rows you can see from the 300,000 available.
|
|
|
|
|
Dave Kreskowiak wrote: Nobody is going to look through 300,000 records for anything. On top of that,
you're loading all of those into a DataTable, burning up network bandwidth
transmitting all those records and burning up memory because you're storing them
all in a DataTable. Virtual mode is intended to give you an
oportunity to retrieve only the visible subset of the larger recordset being
viewed. For example, if your displayed grid is only 20 rows high, you can
retrieve only the 20 rows you can see from the 300,000 available.
Thank you for your feedback.
Your observation is very interesting. I say this becuse the tool returns 300K+ of records in under 6 seconds and 4 of those seconds is the time it takes the query to return results and the other 2 is the load time into the DataGridView. Please keep in mind we are dealing with an Ad-Hoc Query tool which allows the user to design any query they want to. It is up to the application to properly handle what they have designed and return the results in a reasonable amount of time.
I am really asking for advice on why the DataGridView works one way then another way when dealing with the exact same circumstances being executed twice. I defintiely want to enlist other design concepts but criticism without providing another solution is frankly useless to me.
Thanks
|
|
|
|
|
OK, I've told you what the design goal of virtual mode was and how it was intended to work. What you do with that information is up to you.
|
|
|
|
|
I have to write a code where i have to ask user on production lane for identity card. The code would be insert form light scanner. I would like to block press buttons from 0 to 9 by:
Private Sub op1start_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles op1start.KeyDown
If e.KeyCode = Keys.D1 Or e.KeyCode = Keys.D1 Or e.KeyCode = Keys.D2 Or e.KeyCode = Keys.D3 Or e.KeyCode = Keys.D4 Or e.KeyCode = Keys.D5 Or e.KeyCode = Keys.D6 Or e.KeyCode = Keys.D7 Or e.KeyCode = Keys.D8 Or e.KeyCode = Keys.D9 Or e.KeyCode = Keys.D0 Then
e.SuppressKeyPress = True
End If
when the user scans the card. The user has a tablet there he could insert his code by buttons. I have to forbid that.
Could i make events in inputbox?
Please help
|
|
|
|
|
lukaszo44 wrote: The user has a tablet there he could insert his code by buttons.
..and using the clipboard (copy/paste) and probably by entering the ASCII value while holding the alt-key.
Why, isn't the code you posted working?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
sounds like you are using a scanner which emulates a keyboard.
Basically, when you scan a barcode, it generates the characters in the keyboard buffer area so that the application doesn't realize that the data is coming from a scanner versus coming from the scanner.
The problem with this type of scanner is that you have to have the focus set on the proper input box to capture the data.
What you want is a scanner which writes the data to the serial (USB) port and have your application be responsible for capturing the data. Using this method, there is no way for the operator to enter values into the system from the keyboard or copy/paste buffer.
Good luck.
|
|
|
|
|
Hello,
what is the exact conversion of c# code to vb6.0 code
for these two lines:
FileInfo file = new FileInfo(Server.MapPath(FileUpload1.FileName));
Int64 numofbyte = file.Length
FileStream fs = new FileStream(Server.MapPath(FileUpload1.FileName), FileMode.Open);
BinaryReader br = new BinaryReader(fs);
byte[] DataFile = br.ReadBytes(Convert.ToInt32(numofbyte));
Are there any converters for converting my c# code to vb 6.0 code ?
Thanks,
|
|
|
|
|
Karthik Reddy wrote: Are there any converters for converting my c# code to vb 6.0 code ?
No. That would be blasphemy.
Karthik Reddy wrote: Server.MapPath
VB6 is not a web-technology. You'd have to write a custom method to replace this.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Karthik Reddy wrote: Are there any converters for converting my c# code to vb 6.0 code ?
Why on Earth would anyone write a converter to convert modern code back to something used in the Stone Age??
No, there's no such thing.
|
|
|
|
|
Hello,
I am trying to write a VBscript that allows me to search the file names of every file in a folder and rename them accordingly. For example, I'd like to find all files that begin with RX345678 and replace that name with Bob & MMDD & counter & .txt The counter will allow for the multiple factor. I already have the code for the date, but, it's pulled from an old script and it's been forever since I wrote in VB so my naming is poor.
This is also in Visual Studio 2005 (yeah, I know! )
Thanks for any advice!
|
|
|
|
|
Where is the code you already have, and where are you stuck? Should the serial-number reset after each date, or would you be satisfied with a single range?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Sub FormatDate
'Set datepart("yyyy",date()-1) & datepart("m",date()-1) & datepart("d",date()-1)
If len(datepart("m"))=1 Then
monthstr = "0" & datepart("m")
Else
monthstr = datepart("m")
End If
If len(datepart("d")=1 Then
daystr = "0" & datepart("d")
Else
daystr = datepart("d")
End If
objDatestr = datepart("yyyy") & monthstr & daystr
End Sub
Is the current date code. I'm stuck on the proper language to use in order to read the file name and rename it. What I am thinking I would like to have is a routine for each name that could occur. Max = 9. I don't know the number of files per name, so, that's why I was going to add the counter. In each routine, it would search for a specific name and turn that into what I expressed before. I know I sound stupid, but, I know how to code and I know what I want but, this got dumped into my lap and we have no resources here to assist me.
The counter will be set to 0 before each routine. (in my version).
Thanks for anything that points me in the right direction!
|
|
|
|
|
I suggest you start with a routine that lists all the files, and sorts them. Loop through them after that, reset your counter when the date changes.
Most code you'll need can be found here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the suggestion and the link. I checked it out but, not really sure I'm searching on the right things. Oh well, guess it's off to the book store for some blurry-eyed late nights.!
|
|
|
|
|
Hello,
I've developed a .net dll and made it com Visible and also i've added register for com interoperability.
I need this COM object in visual basic 6.0.
It works fine, when i build the .net component. It generates a .tlb file and i could get my result as expected.
But when i executed this on the other machine it shows error.
i've copied my dll to the other machine and generated a .tlb file by using 'regasm'.
I can see the tlb file in references of my Visual Basic 6, but it is giving error that "Could not load file or assembly 'thirdpartydll' or one of its dependencies".
i've tried by registering with GAC but could not solve my problem .
please help me !
Thanks,
|
|
|
|
|
Did you reference any other libraries in your control?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i did not add any library references in vb6.
|
|
|
|
|
Karthik Reddy wrote: I've developed a .net dll and made it com Visible
Which assemblies does your .net dll reference?
--edit;
Rephrased
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
modified 21-Aug-12 6:49am.
|
|
|
|
|
No. He meant did you have to add a reference to anything in your VB.NET code that you wrote this COM component in?
|
|
|
|
|
I did not add the references in vb6 application.
but my component has references in it.
do i need to add those references which are in my component ?
|
|
|
|
|
Karthik Reddy wrote: do i need to add those references which are in my component ?
You do indeed. Anything used by your dotNet component must exist in any environment that you deploy the component to. Dependencies are not going to be compiled into your assemblies.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Not quite. Any unresolved references in the VB.NET COM component will NOT be resolved by adding a reference in the VB6 project using the component.
He's still stuck on adding references to his VB6 code to fix this, which we all know won't work.
|
|
|
|
|
Sorry. Maybe I wasn't clear enough. If the assemblies required by the COM-Interop assembly are available in either the install directory of the component that requires it or in the GAC, then his reference of the COM component through VB6 should work. I'm working from memory here as I haven't done anything like this in a couple of years.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Oh, no, you were clear. I'm just saying if the assemblies were present, he wouldn't be have the problem in the first place and hence wouldn't need to add references to them in his VB6 project.
|
|
|
|
|
Understood. I reread your response and that was clear. I just must have read it too quickly. Cheers.
I wasn't, now I am, then I won't be anymore.
|
|
|
|