Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is no run.exe file in Windows.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There's no way of telling without seeing the query string. Replace

Dim CMD As New OleDb.OleDbCommand(simpan, CONN)

with

Debug.WriteLine(simpan)
Dim CMD As New OleDb.OleDbCommand(simpan, CONN)

and post the output here. Unless the strings you are concatenating contain "?", none of the parameters will be added. You may want to look at this to see how parameters work.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you asked me to guess your profession I would have to say engineer. I never knew one who didn't write code like that.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I worked with a few programming jokes, but to be fair, they probably thought the same of me.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't run this locally because you supplied only the code that runs the form. I am not going to create all the controls manually and guess as to their placement or grouping. Please zip the project folder and post it.

The simplest code to just merge the files would be

Dim filelist() As String = {"d:\temp\don\20150228.txt", "d:\temp\don\20150301.txt", "d:\temp\don\20150302.txt"}

Dim sw As New System.IO.StreamWriter("d:\temp\don\out.txt", False)

For Each file As String In filelist

    Dim lines() As String = System.IO.File.ReadAllLines(file)

    For i = 0 To UBound(lines) - 4
        sw.WriteLine(lines(i))
    Next

Next

sw.WriteLine("")
sw.WriteLine("")
sw.WriteLine("                                                       End of Report")
sw.Close()

Note that I just dummied in three files. If you create a list of file names by scanning the folder and use the same loop then it should work no matter how many files are in the list.

ddanbe commented: Pro speaking here! +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Microsoft has made many changes from Windows 7 to Windows 10. They redesigned the start menu (and made it worse) after having removed it in Windows 8. They've, yet again, rearranged everything so I have to go looking for the new locations, etc, etc. The thing I am absolutely the least concerned about is a new icon for the trash bin.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think your code would be a lot clearer, less prone to typos and easier to modify if you used intermediate variables. For example

DailyRate = arrDailyRates(cboBoard.SelectedIndex)

Select Case cboBoard.SelectedIndex

    Case 0 To 1

        If intDaysRented = 0 Then
            If intHoursRented > 3 Then
                cost = DailyRate
            Else
                cost = arrHourlyRates(cboBoard.SelectedIndex)
            End If              
        Else
            If intHoursRented > 3 Then
                cost = DailyRate * intDaysRented
            Else
                cost = DailyRate * intDaysRented + arrHourlyRates(0) * intHoursRented
            End If
        End If

    Case 2

        If intDaysRented = 0 Then
            If intHoursRented > 2 Then
                cost = DailyRate
            Else
                cost = arrHourlyRates(cboBoard.SelectedIndex) * intHoursRented
            End If
        Else
            If intHoursRented > 2 Then
                cost  = DailyRate * intDaysRented
            Else
                cost = DailyRate * intDaysRented + arrHourlyRates(2) * intHoursRented
            End If
        End If

    Case Else

        MsgBox("Something has gone terribly wrong with board selecting process.")
        End

End Select

lblCost.Text = FormatCurrency(cost, , TriState.True, TriState.True)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Wesley Clark was an idiot (in this case, at least).

There was a case many years ago where a keyboard timeout in the software controlling the radiation treatment of a patient in Pinawa (Manitoba) resulted in the patient getting several hundred times the dose of radiation that he was supposed to. Some things done by software cannot be undone. Let's never forget that software affects more than the setting of ones and zeroes and pretty pictures on the screen. Software is used to manage financial transactions, control nuclear reactors, airplanes, missile silos and much more. In many of these cases, mistakes cannot be undone.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You have to add adodb to the project.

Project -> Add Reference
.NET tab
Sort by component name
select adodb
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You start by putting in some effort on your own. Google it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think Algol used that form as well. I think it was to appease mathematicians who objected to an equality statement being used for assignment. Same reason that APL uses a left arrow for assignment.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In 1966 in a controlled study, 26 people chosen for creativity in their fields (such as a theoretical mathematician, an electronics engineer, a furniture designer, and a commercial artist) were given controlled doses of LSD to see if the drug could increase their creativity. Seveeral of the innovations resulting from the study included a mathematical theorem for NOR gate circuits, a conceptual model of a photon, a linear electron accelerator beam-steering device, a new design for the vibratory microtome, a technical improvement of the magnetic tape recorder, blueprints for a private residency and an arts-and-crafts shopping plaza, and a space probe experiment designed to measure solar properties. Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Personally, I have concerns about the ability of my private conversations being open to monitoring. If my words are being sent into the ether then this is possible. Having said that, I have a laptop (several, actually) in the house, all of which are equipped with webcams and microphones and we have all heard stories about such devices being activated without the user's knowledge. In some cases this was done by authorities (school officials) acting in their official capacity, and in other cases by criminals not acting with any "authority". While I have the technical savvy to prevent such abuse, most people do not. I would not have such a TV in my house, even with the assurrance that I could disable the monitoring feature. Making an icon disappear from the screen does not mean that anything is disabled other than the displaying of the icon. We have been lied to before about the ability of our cell phones to collect and analyze our movements.

  1. The phone does not record your movements
  2. Well, it does but only so we can improve the service. We don't save the data.
  3. OK. We save the data but we don't tell anyone about it.
  4. Maybe the government, but only if they ask for it.

Who can say if a cell phone (or even your land line) can be remotely enabled to monitor your conversations without your knowledge. This may be paranoid rantings, but we have all seen that when such an ability is …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Buy anything but a Dell.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm still having a problem when typing text in the edit box. When I get to the bottom of the edit box the text does not scroll to keep the cursor in view. The box expands to 20 lines and then the scroll bar appears, however, the scroll bar does not scroll as I type which means that I either have to enter a few blank lines, then scroll down, then cursor back up, or I have to manually drag the scroll bar down every time I start a new line. This is a problem in Chrome version Version 40.0.2214.111 m, but not in Firefox 35.0.1.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I agree with you on the first comment. If I was just left to my own programming I'd get better in only a few areas at the expense of many others. By answering questions on Daniweb I stretch myself in other areas and keep current in areas (like SQL) that would otherwise atrophy.

has a higher value among developers and other people as well than Daniweb

I don't know if that is entirely true. Due to a change in Google ranking, Daniweb search results got royally hammered. This had (to my knowledge) nothing to do with the quality of the answers. It was a purely arbitrary decision by the programmers at Google.

I've been to Stack Overflow and I didn't stay, for one, because I really hate the user interface, and for another because I found the general attitude to be snarky and rather unfriendly.

I any case, I don't consider your choice to be either moral or immoral. It's simply your preference. If, however, you started copying solutions from Daniweb and posting them on Stack Overflow, or anywhere else, I would probably be of a different opinion.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

SELECT  (SELECT SUM(total) FROM icm.sales)  AS branch1_sales,
        (SELECT SUM(total) FROM hism.sales) AS branch2_sales
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Albuterol is one of the oldest asthma medicines being prescribed. A decade ago an inhaler of Albuterol cost under $15. Today, after being "repatented" the same inhaler costs $50 to $100. In Great Britain, Pulmicort costs the pharmacist (chemist) abut $20. In the US it retails for over $175. Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try testdisk. It's free and open source. I haven't had the occasion to try it out but I've read good things about it. There is a step by step here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Any time. The questions I like the best are the ones where I get to learn something new.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Apparently it has to do with launching a 32 bit app (osk). Try the following...

Public Class Form1

    Declare Function Wow64DisableWow64FsRedirection Lib "kernel32" (ByRef oldvalue As Long) As Boolean

    Private osk As String = "C:\Windows\System32\osk.exe"

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Wow64DisableWow64FsRedirection(0)
        Process.Start(osk)

    End Sub

End Class
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Just make sure that any block of text you write is terminated with a vbCrLf.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What you want to do is identify all occurrences of the word "go" (ignoring case) while ignoring any occurences of the string "go" that are embedded in a word. A regular expression will do that.

Imports System.Text.RegularExpressions

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim rex As New Regex("\bgo\b", RegexOptions.IgnoreCase)
        Dim str As String = "Please, go Mr. Gofer and good bye"

        For Each m As Match In rex.Matches(str)
            Debug.WriteLine(m.Index)
        Next

    End Sub

End Class

In a regular expression, the meta-character "\b" matches a word boundary so "\bgo\b" matches the word "go". The above loop will identify the starting position of each "go". In this case you want to replace two chars (go) with two chard (vbCrLf) so once you know the starting position of the word it should be a simple matter to write the code to do the substitution. Because you are replacing two chars with two chars, replacing the first occurrence will not affect the starting index of any remaining occurrences.

ddanbe commented: Nice. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You might need to do it from the command prompt running as Administrator. Assuming your logonid is Eileen you will have to check both

C:\Users\Eileen\Desktop
C:\Users\All Users\Desktop

Do a dir from both locations. You should see the folder from one of them. Then use the rd folder /s /q command to remove it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I haven't seen a driver update utility that was worth installing. Most come with so much crap (or are nothing but crap) that they cause more problems than they (supposedly) fix. If your computer is running fine then leave the drivers alone unless an update

  1. fixes a bug that you have observed
  2. adds a feature that you need/want
Smalls commented: Very much agreed! +3
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

"Look at the world today. Is there anything more pitiful? What madness there is! What blindness! What unintelligent leadership! A scurrying mass of bewildered humanity, crashing headlong against each other, propelled by an orgy of greed and brutality."

James Hilton (Lost Horizon)

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could try the following using regular expressions

Dim Files() As String = System.IO.Directory.GetFiles("D:\Utils")
Dim fltr As New ArrayList
Dim opt As RegexOptions = RegexOptions.IgnoreCase

'Add all filenames starting with CE

For Each file As String In Files
    Dim basename As String = My.Computer.FileSystem.GetFileInfo(file).Name
    If Regex.IsMatch(basename, "^CE.*", opt) Then
        fltr.Add(basename)
    End If
Next

ComboBox1.DataSource = fltr

fltr.Clear()

'Add all filenames starting with BE

For Each file As String In Files
    Dim basename As String = My.Computer.FileSystem.GetFileInfo(file).Name
    If Regex.IsMatch(basename, "^BE.*", opt) Then
        fltr.Add(basename)
    End If
Next

ComboBox2.DataSource = fltr

In regular expressions, the caret (^) anchors the pattern to the start of the string. The ".*" matches any string, so "^CE.*" matches any file that starts with CE.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Too bad the cheaters won.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Rather than checking the text length you should check if the textbox contains a number. This wouuld not require trimming and would also ignore non-numeric entries such as "abc". The following code should be reasonably self evident.

Dim nums As New ArrayList

For Each txt As TextBox In Me.Controls.OfType(Of TextBox)()
    If IsNumeric(txt.Text) Then
        nums.Add(CInt(txt.Text))
    End If
Next

nums.Sort()

If the form contains other text boxes you could always put the related boxes in a container and do the for loop on that container.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sorry. That should have been

If rdr.Read Then
    Dim imgdata() As Byte = rdr("pic")
    Dim str As New MemoryStream(imgdata)
    Button1.BackgroundImage = New Bitmap(Image.FromStream(str))
    str.Close()
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about

SELECT (SELECT SUM(sold) FROM veggies) 
     + (SELECT SUM(sold) FROM flowers)
    AS total
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Put a breakpoint at

lvorder.Items(i).Text = (Val(lvorder.Items(i).Text) + 1).ToString

and see if the code stops there. If not then you are never getting a match. In that case put a breakpoint at

If lvorder.Items(i).SubItems(1).Text = btn.Text Then

and step through each iteration of the loop and check the values oof everything including btn.Text to see if things are what you expect. You might want to rewrite the loop as

For i As Integer = 0 To lvorder.Items.Count() - 1

    If  lvorder.Items(i).SubItems(1).Text = btn.Text Then

        dim quantity as integer = Val(lvorder.Items(i).Text + 1)
        dim unitcost as double = Val(lvorder.Items(i).SubItems(2).Text)
        dim total as double = quantity * unitcost

        lvorder.Items(i).Text = quantity.ToString
        lvorder.Items(i).SubItems(3).Text = total.ToString

        ProdMatch = True
        Exit For

    End If

Next

if only for debugging and you can add quantity, unitcost and total to the watch window.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No difference. SQLDB and OLEDB are merely interfaces. The actual data storage is a function of the underlying database. Consider the database like a huge parking lot and SQLDB and OLEDB the highway you use to get vehicles to/from the parking lot. For small to medium databases (I can't actually define what constitutes small or medium), something like Access is sufficient.

Before I retired, one of our developers built an application in Access. Unfortunately, once the amount of data got to a certain size (don't recall what that was) I would get a 3:00 AM call about once a week from the control centre saying that the application was broken. For some unknown reason, it required a database repair/rebuild about once a week. Also, unfortunately, the control centre staff required 24 hour availability. Fortunately a 3:00 AM call meant two hours double time pay for me. We never had this problem with our SQL databases even though they were magnitudes bigger.

Microsoft sunk a few billion dollars into developing MS SQL and a few hundred million into Access. Which do you think is more robust?

Please don't forget to mark this as solved if you got what you needed.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you are using MS SQL as your database then you should be using SQLDB rather than OLEDB. Both are built on top of ADODB (which you could also use), however, SQLDB is optimized for MS SQL. OLEDB is used for other data sources. In terms of complexity I don't see any difference between SQLDB and OLEDB. If you are using MS SQL, but plan to (possibly) use other data sources then stick with OLEDB and just change the connection string as required.

Santanu.Das commented: Mind-blowing +5
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Until last month I would have whole-heartedly recommended Dell. However, I have spent the last month in Dell Hell and can no longer give them my support. They useed to have excellent (really top-notch) after sales support. Now it's just an exercise in one useless conversation after another with people who don't know how to do anything except read from a script. The one technical problem I was having with a new laptop resulted in, after the tech staff got their mitts in, a worsening of the problem. Please see Warning. Dell Laptops May Cause Insanity.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you are calculating the tootal price for each dish you need to know

  1. the quantity
  2. the price per unit (the rate)

Your table only has columns for

  1. the quantity
  2. the name of the dish
  3. the total price

You need to add a column indicating the cost (rate) of the dish.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Assuming this is some sort of login form, what you would usually do it compare the entered username and password to a stored username and password (such as in a database). Since I don't know what you are comparing it to I'll just use literals as

If txtUsername.Text = "Bilbo" And txtPassword.Text = "Baggins" Then
    MsgBox("Access granted")
    LoggedIn = True
Else
    Msgbox("Incorrect login")
    LoggedIn = False
End If

The problem with using an onscreen keyboard is that as soon as you click on a key whatever textbox you were in loses focus so you have to keep track of what control you were just in. You can do that by declaring a class level variable like

Private currText As TextBox = Nothing

Then in the Enter event for each textbox you set the value like

Private Sub txtUsername_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUsername.Enter
    currText = sender
End Sub

In the Click event for your keyboard keys you can do

If Not currText Is Nothing Then
    currText.Text &= "A"
End If

You could even generalize the keyboard to use the same event handler for all of the keys. That would be the preferrred way since all of the keys have the same code except for that actual key entered (which can be determined from the displayed value on the key).

By the way, you should be using & to concatenate strings instead of using +. It would also be …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'd estimate I spend anywhere from 1-3 hours per day on DaniWeb. When I started as a noob back in 2010 I had already been programming for over 30 years but never in vb.nbet so I didn't need help with technique algorithms as much as I did with vb.net specific nuances and gotchas. As I got answeers to my questions I found that there were many newer programmers who were struggling with the actual concept of turning ideas into code and I was able to help out.

I have found that while getting an answer to a particulary vexing problem is satisfying, helping someone else is much more rewarding. I have learned that when it comes to programming, most people are eager and willing to learn something new. When it comes to just about everything else (climate change, politics religion), the chances of changing anyone's mind are pretty close to zero. But that doesn't stop me from trying.

2012-09-19-TGAG_202_The_Breakthrough.jpg

almostbob commented: solid old gold +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The Roman Catholic Archdiocese of St. Paul and Minneapolis filed for bankruptcy protection in the wake of yet another clergy sexual abuse scandal, becoming the 12th US diocese to do so. It's funny how the right wing keeps telling us how we could have prevented the killings in the schools if only we had kept God in them. How many child molestation/rape cases did God prevent in his churches?

Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What happens when you reboot and press F8? Do you get the option to boot windows normally?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Researchers at Yale were able to teach Capuchin monkeys the concept of money. The first use of that money was to buy sex. The monkey receiving the money used it to buy grapes. Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Based on numbers in the bible, God killed at least 2,476,633 people (not counting those who died in the flood - no numbers are given for that), while Satan killed a mere 10. Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The book that holds the world's record for "most often stolen from the public library" is the Guinness Book of Workd Records. Source

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you use Markdown Pad instead of Notepad then you can see what the formatted post will look like.

Tcll commented: nice resource +4
AleMonteiro commented: really nice app +9
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In 2013, millionaires made up more than 50% of the US Congress.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Just saw the movie, Elysium. I'm glad I only paid $1.20 to get it from the library instead of full price in the theatre when it was released. The writers put almost no thought into this movie at all. There were plot holes you could fly a space station throough and the science was essentially non-existent although the commentary throws the term "Stanford taurus" around a lot. My son and I ended up pressing "pause" frequently to cry bullshit. Actually, that kind of got to be fun - more fun than the movie.

RobertHDD commented: Cheey and boring movies in fact science is way better +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For OLEDb the synax would be

Dim da As New OleDbDataAdapter("SELECT * from EncodingComplete where (Date_Bill BETWEEN ? AND ?) AND Client like ? Order by Date_Bill desc" , con)

Please note that the parameter values must be added in the order in which they appear in the query.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In the United States you are statistically in less danger of dying from a terrorist attack than from a toddler accidentally shooting you.

<M/> commented: true +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's a hidden folder. You have to enable "Show Hidden Folders, Files and Drives" in folder view.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Why do so many people expect to be rewarded...

I don't know about other places, but here in Winnipeg there was talk a few years ago about something which I believe is at the root of the problem. Some teachers felt that it was proper to give either a lower grade, or even no grade, for assignments which were not handed in on time. This is a position with which I strongly agree. In the real world you don't credit for work that you don't do. I seem to recall that the teachers were told that they were to allow work to be handed in late with no penalty. Furthermore, it is now almost unheard of for a child to repeat a grade. Everyone gets moved through the system regardless of proven ability or proficiency.

I think that there is a strong sense of entitlement being fostered in our children and I think that this hurts them in the long run.

Turn on any newscast and you see CEOs of the same companies that caused the financial crash being rewarded instead of punished. You see people with no discernible talent, people who contribute nothing to society other than providing fodder for tabloids (think Kim Kardashian, Paris Hilton and any Real Housewives or Jersey Shore cast member) raking in millions.

And you ask why people expect to be rewarded for doing nothing?

Nearly 50% of the US population now receives government handouts in one form or another.