My god, what a thread... :omg: Best laugh I've had in months. :laugh:
OldWarhorse
Posts
-
Design Methods ? [moved] -
ok what are the rules"Eppur si muove" - ? :)
-
connectivity in vb6You just asked for about 100 pages worth of information in any one of 2 or 3 HUNDRED books published in the last ten years, and ALL of which is available on MSDN... :omg: :wtf:
-
How to improve Software Performance when there is huge Data in SQL Server Using VBSunil, You just answered your own question. (Guy goes to the doctor and says "Doctor, it hurts when I do this." Doctor says, (all together now),) "DON'T DO THAT!" The problem is not on your database side, it is on the client side, in your code. Yes, using a for loop and adding one record at a time is the SLOWEST way to fill the grid. Use databinding if at all possible. But first of all, you haven't provided enough information to really help here. Can't fix what ya can't see. Tell which version of VB, which datagrid component you are using, which type of backing store you are filling the grid from (ADO recordset, .Net datatable, datareader, whatever), and show the sql. :)
-
Printing problems in VBThat's what I was afraid of... Been a long time since I messed with that. I wish I had a good example for you, but there should be a bunch of em out there (good ol' Google).
-
Hard drive InfoYou're welcome! :-D (I gotta go do some nasty work for a while now. Fighting an 8-headed datagrid monster. Catch ya later. Happy coding.)
-
Function; changing ByRef to ByValExcellent. Good work! :-D
-
Hard drive InfoTry something like this:
Dim dr As New System.IO.DriveInfo("C") Dim sizeInBytes As Long Dim sizeInGB As Single sizeInBytes = dr.TotalSize sizeInGB = sizeInBytes / 1000000000 TextBox1.Text = String.Format("Total Drive Size in Bytes: {0}", sizeInBytes.ToString("#,###,###,###,###")) TextBox2.Text = String.Format("Total Drive Size in GB: {0}", sizeInGB.ToString("###,###,###,###.00"))
You can play around with the verbage, divisor value, and formatting as you prefer.
-
Printing problems in VBLooks like the graphic might be overlaying the print buffer. I would try the simplest approach first, and put an EndDoc after the listbox loop and see if that will flush the buffer without advancing the page. Failing that, you might have to set the text and graphics onto a Form or Picture box first, and then call PrintForm.
-
Hard drive Info:laugh: - You crack me up, Dude. Hey, the only dumb question is the one you should have asked and didn't, right? :)
-
Hard drive InfoSystem.IO.DriveInfo Boy, you're being a P.I.A. today. You're gonna owe me a cut of that app. :laugh:
-
Function; changing ByRef to ByValThe reason she wants you to change it to ByVal is to see if you understand the difference between passing arguments by value and passing them by reference. Obviously, you don't yet. You just skimmed over that section in the book, and you can't do that. This key point is fundamental to just about all programming languages, not just VisualBasic. We could just show you how to change it and make it "give the right answer", but that would doing you and the industry a grave disservice. So go back to your book, find that section, and re-read it. Several times if necessary. This may also help. Visual Basic Language Concepts Differences Between Passing an Argument By Value and By Reference http://msdn2.microsoft.com/en-us/library/eek064h4(VS.80).aspx[^] Hint 1: ByRef gives your procedure code a direct view back to the original variable. ByVal gives your procedure code a COPY of, and an indirect view of, the VALUE of the original variable. Hint 2: Why code a Function if you are just going to call it as a Sub and not use the return value from it? ;)
-
create array on runtimeOK. Here's what you need to do. Or what I would do.* I would use a HashTable of ArrayLists. Quick, easy, efficient, fairly robust, good cost/benefit ratio. Downside: Not strongly-typed. You don't want to use raw arrays because you would either have to oversize them to begin with (how many? 1000? 5000? Wasteful and error prone), OR you would have to keep ReDim'ing them (bad performance). You could use ArrayList to get around that problem, but you still have no good keyed access to your entries. That's where the HashTable comes in. The HashTable (or Dictionary<..>, depending on your version and requirements) simply stores entries of Key and Value pairs. In this case your Key would be the Call Center number, and it's Value would be an ArrayList. The ArrayList would store the Agent objects. Every time you hit a new call center, you create a new hashtable entry using the call center number as the key, and a new arraylist with the Agent on that call as it's initial value, which effectively allows you to "create a new variable at runtime with a particular name". (Or, instead of storing the agent object in the arraylist slot, you could create a hashtable of Agents, and just store a reference to that agent's entry in the arraylist slot.) How do you know it's a new call center? By using the ContainsKey function of the hashtable, or by simply trying to access the item with that key. If it doesn't exist, you get back Null. If it does exist, you add the agent (or a reference to the agent) to its arraylist. Simple. If you're not familiar with hashtables, take an hour or so and read up on them. Set one up and play with it. Don't be afraid of them. Very powerful tool. *Now. All that having been said, this is NOT the only way or best way to engineer this, it's just a quick-and-dirty as far as I look at it. Keep in mind what Dave K. said. What you're really doing here is modeling and managing entity relationships. Call Centers, Agents, Calls, Extensions... Which means you might be better served to use a strongly-typed DataSet, with Tables and DataRelations to begin with. You are probably going to need to do that eventually anyway. Hope this helps. Good luck.
-
Make a trial [modified]Here are some ideas... How to create a Trial Version http://groups.google.com/group/microsoft.public.fox.programmer.exchange/browse_thread/thread/ab06c1938cce6361/8b8332b489c0f434%238b8332b489c0f434[^] -- modified at 22:33 Saturday 4th November, 2006 Here's a commercial crack-protector that says it will create a trial version, and a list of similar products... (I don't know anything about them...) http://www.soft32.com/download_7549.html[^]
-
Having a form name , how to show this form ?This is not a trivial task. If all you have is the simple form name as a string, then you need to use some sort of Reflection to create an instance of that type, AND you have to use the full name of the type, which is "Namespace.Type". Here's one approach: "Loading Classes on the Fly" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet10082002.asp Here's a similar way, that does not use a configuration file. I just used the assembly name, which should work, unless you or another developer has placed the forms in a different namespace. Either way, you have to know the namespace of the type. If it happens to be the same as the assembly, which usually it will be, then you're in good shape. If not, you just have to know the namespace, and prepend it to the form name. (And don't forget to use proper exception handling. Do as I say, not as I do.)
Imports System.Reflection
Module Module1
Friend Function GetFormUsingGetType(ByVal formName As String) As Form
Dim myAssembly As [Assembly] = [Assembly].GetExecutingAssembly
Dim myForm As Form
Dim myFormName As String
Dim myType As Type
Dim myAssemblyNameObj As AssemblyName = myAssembly.GetExecutingAssembly.GetName
Dim myAssemblyName As StringmyAssemblyName = myAssemblyNameObj.Name myType = myAssembly.GetType(myAssemblyName & "." & formName, True, True) myFormName = myType.FullName myForm = CType(myAssembly.CreateInstance(myFormName), Form) Return myForm
End Function
Friend Function GetFormUsingActivator(ByVal formName As String) As Form
Dim myForm As Form
Dim myFormName As String
Dim myAssemblyNameObj As AssemblyName = [Assembly].GetExecutingAssembly.GetName
Dim myAssemblyName As String
Dim obj As System.Runtime.Remoting.ObjectHandlemyAssemblyName = myAssemblyNameObj.Name myFormName = myAssemblyName & "." & formName obj = Activator.CreateInstance(myAssemblyName, myFormName) myForm = CType(obj.Unwrap, Form) Return myForm
End Function
End Module -
Recent files in comboboxHere's some VB6 code you might be able to use: http://www.freevbcode.com/ShowCode.asp?ID=6529[^]
-
WeifenLuo formsFirst of all, look here: http://216.239.51.104/search?q=cache:sa17H0oSzSkJ:www.codeproject.com/cs/miscctrl/DockManager.asp+WeifenLuo+forms&hl=en&gl=us&ct=clnk&cd=9[^] Then here: IMPORTANT NOTICE: DockManager control is now obsolete and not supported. Please download the upgrade, DockPanel Suite, from sourceforge here. http://sourceforge.net/projects/dockpanelsuite[^] Then, I think you would get a better response and more info here: http://sourceforge.net/forum/forum.php?forum_id=402316[^]
-
create array on runtimeGoogle this: "jagged arrays vb .net"
-
How to swap values in database with the help of comboboxSee your first post.
-
SwapingSafecom wrote:
I m using combobox to get values from database.
No, you are using a DataProvider to get values from the database. Those values are provided to you in a stream. You can put those values into various containers, eg. a DataTable, an Array of List Objects, etc. which can then be fed or bound to your control. They should be encapsulated in a list of business objects, (preferably using a list type that implements IList - ArrayList is good) which is then manipulated (sorted according to your business rules, which may change momentarily by user gestures such as clicking radio buttons, checkboxes, etc.) and then presented to the user in the ComboBox. You may need to add a suitable sort key to your business object to help with the re-sorting/swapping. You can do all that off the DropDown event if necessary, but you will take a performance hit. It would be better to evaluate your conditions beforehand if possible, using other control events, and re-sort the list (and rebind the list to the control) before the user drops it down. SelectedIndexChange is too late. The user has already seen the list.