User Profile

Collapse

Profile Sidebar

Collapse
JonJacobs
JonJacobs
Last Activity: Feb 26 '08, 01:20 PM
Joined: Aug 3 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • The best way I know would be with SQL coding, and your vb coding would just execute the SQL.

    Let us know if you need more detail....
    See more | Go to post

    Leave a comment:


  • True enough. I flush everything, just in case, since I am new to VB, and I am paranoid. <g>...
    See more | Go to post

    Leave a comment:


  • Failing to close the stream before using the buffer will have variable results, but it is definitely the source of the problem....
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Drawing Tools In Vb 2005
    Amendment:
    Imports System.Drawing. Graphics

    then you can use:
    DrawEllipse

    Pass it a pen and a bounding rectangle. If the bounding rectangle is a square, then your ellipse is a circle.
    See more | Go to post

    Leave a comment:


  • You need to flush and close then IN stream before you write to the OUT stream, otherwise you might not get everything you need into your buffer.

    I modified your code accordingly, and it worked fine for me, when I made that change.

    HTH...
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to List boxes
    In light of the stated goal, I interpret your use of "select" simply to mean that you want access to each item in the listbox and the ability get each one in to a variable, rather than user selection of one or more items.

    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim Price As Double
            Dim Total As Double = 0
    ...
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Drawing Tools In Vb 2005
    If I understand your situation...

    Imports System.Drawing

    etc.

    If that is not sufficient, you might need to do Add Reference.

    HTH
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to OpenFileDialog Question
    Code:
    Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
            Dim Fn As String
            OpenFileDialog1.DefaultExt = MyExpectedExtension
            OpenFileDialog1.InitialDirectory = "C:\MyMusic"
            If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
                Fn = OpenFileDialog1.FileName
            Else
                Exit Sub
    ...
    See more | Go to post

    Leave a comment:


  • VC++ does name-mangling, uh I mean decorating, for exported routines. Perhaps you need the "decorated" name rather than just plain "add" for your entry point.
    See more | Go to post

    Leave a comment:


  • Perhaps you need short-circuit evaluation.
    The Or operator still evaluates both sides of the expression even if the first side is true, so the whole expression is true. With short-circuit evaluation, if the first side of the expression is enough to determine the overall value, the rest of the expression is not evaluated, thus protecting against evaluating something that may no longer be valid.

    You might try using OrElse instead...
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Random number generator
    Good point!

    All the situations I had to do something like this involved using up the values and stopping when they were all consumed. I should have thought a little beyond that....
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to shifting of characters
    What version of VB? I'm only familiar with vb.net.

    One thing you might try, if it is available in your version, is change the string to an array of characters, then you can access each character at will.
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Progress bar
    Someone suggested breaking the query into smaller pieces so you could update the UI between the pieces.

    That may be a good idea for an additional reason.

    If the query is complex or has a lot of joins, sometimes breaking the query up into smaller pieces, carefully chosen, can actually Speed Up the process. I have experienced this many times. Might be worth looking at.

    What database system?

    ...
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to How to use Date and Time in VB?
    Sorry, I had to guess at the version. datetime is legit in vb.net (VS 2005 I think) that I use at work....
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to How to use Date and Time in VB?
    Code:
    Const MyFormat = "my chosen date format" ' replace with real format
    Dim MyDate as datetime = Date()
    Dim S as string = MyDate.ToString(MyFormat)
    'Display S in the appropriate place
    HTH
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Textbox IF statement
    [CODE=vb]Public Sub DoSomethingStra nge(A as String)
    'Put whatever logic you need in here
    End Sub

    Dim Answer as string = Textbox1.Text
    If Answer="Do Something, Please!" then
    DoSomethingStra nge(Answer)
    End If[/CODE]

    HTH
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to Random number generator
    Yes, it's possible, but not as simple and straightforward as just generating random numbers.

    One approach would be to create an array of byte (or integer, etc., but your numbers are small enough for byte) and fill it with your numbers in proportion to your desired frequency of occurrence. a(0) to a(9) might have 40. a(10) and a(11) 41, a(12) to a(16) 42, etc. or whatever whacky or sensible arrangement you want. Now, use your random...
    See more | Go to post

    Leave a comment:


  • SQLServer has Identity fields that are basically auto-increment numerics. I don't know if Access has something like that, but if it does, then create a temporary table with an auto-increment column and select your report records into the table, then make your report based on the new table, that now includes a "serial number"

    HTH

    Jon
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to vb.net form not responding
    in .NET
    Perhaps code like this will help...

    Label1.Text = SomeDataReturne d()

    Label1.Update ' This will help make sure the new data displays

    Jon
    See more | Go to post

    Leave a comment:


  • JonJacobs
    replied to replacment of characters
    Let's see if I understand your question:

    User types 12345 in textbox1. You want to put A2345 into textbox2.

    If I understood correctly, try this code (vb.net):

    Dim S as string = TextBox1.Text
    TextBox2.Text = "A" + S.Substring(1)

    HTH

    Jon Jacobs
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...