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

Unlike what you see in movies and on TV, it takes at least five minutes of inhaling an item soaked in chloroform to render a person unconscious. Source

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

Unless you have a specific vb.net question you should be posting in some other forum.

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

I suppose you have already noticed this but composing a query by concatenating multiple strings is just butt ugly. For one thing you have to keep track of where to add single quotes and where not to.

The first thing I can suggest is to use the full INSERT syntax in which you explicitly state the column names as in

INSERT INTO tablename (fld1, fld2, ... fldn)
    VALUES (val1, val2, ... valn)

The second thing is to use Parameterized Queries. Please refer to the Sub btnSQLDB_Click.

Because you are using SqlClient you can use named parameters that are not dependent on position. If you copy your TextBox values to appropriately typed local variables appropriate delimiters will be added automatically.

Santanu.Das commented: Perfect suggetion +5
cudawella commented: thank you very much +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How sloppy of me.

Dell Inspiron 5748
Windows 7 Home Premium (all service packs and updates)
All drivers are current

I just found out that the Intel driver was modified by Dell so Intel won't help me. I guess I'll have to enter Dell Hell again and contact Dell support.

Never had any other version or OS installed. Never tried 8.x (except in a virtual machine and hated it). Windows 10 is looking not bad but no reason to change.

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

I was not going through the listbox

I don't know what you mean by that.

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

Intel®HDGraphics4400

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

Please post the new code and this time identify the line that is raising the error.

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

Dell won't fix it because it is not a Dell hardware problem. If it's a problem with Windows then Dell can't fix it. If it is a problem with a video driver then, again, not Dell's problem, it's Intel's.

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

I've already tried the code I suggested and it writes the lines of text to the file as requested.

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

What line is giving the error? By the way, you may want to open the connection before you try to use it.

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

I have had this problem since I got the laptop last December. Video in full screen is erratic. In scenes where there is little motion there is no problem (or the problem exists but is not visible). The problem manifests as a horizontal "tear" about two inches down from the top. In order to capture the problem I had to record a video with a digital camera. I've attached a screen snap of a video frame. My guess is that I am seeing the top two inches of one frame and the rest of another frame. The three players (all current version) display the same problem. I've tried vlc media player, DivX player and Windows Media Player. All of my driver software is up to date. I built a Linux LiveCD on an external drive and boot to that. Try as I might, I could not get the problem to show up in Linux. I've also run a full slate of diagnostics. That plus the Linux success has convinced me it is not a hardware problem.

It doesn't matter if I am playing a low quality (320x240), medium (620x480) or high quality (1280x720) video.

Any suggestions on how to track this down would be appreciated.

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

A ListBox, by definition, contains text. You don't have to convert to String. Try replacing

Caminho.WriteLine(line)

with

Debug.WriteLine(line)

or put a breakpoint at that line and check the values. But don't forget to add

Caminho.Close()

after the loop.

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

Try

For Each line As String In ListBox1.Items
    Caminho.WriteLine(line)
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I agree that changing the law retroactively is a dangerous idea. Certainly making something illegal retroactively is something that should never be allowed. As for making something legal retroactively, I am torn. On the one hand, it allows governments to get away with just about any action. On the other hand, it allows the righting of horrible wrongs. For example, making possession of drugs for personal use legal retroactively would result in the freeing of countless numbers of people who would never have been imprisoned. However, that could also be handled non-retroactively by simply pardoning them all after the fact and expunging their records.

@dlhale - One of your "greats" once said something to the effect that those who would trade freedom for security deserve neither. I agree to a point but I also believe that rights should have reasonable limits. The "yelling fire in a crowded theatre when there is no fire" comes to mind. Requiring that motor vehicle drivers are properly trained and licensed is also a reasonable restriction. Likewise with the regulation of firearms. When your pursuit of happiness conflicts with the public well-being then some restrictions are reasonable and necessary. Unfortunately, congress has decided to use that as justification for all sorts of hanky-panky. On one hand, more than 45,000 people in the US died last year from lack of affordable health care. On the other hand, billions of dollars have been spent on a massive surveillance system that the FBI recently admitted has not stopped …

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

In the U.S. principles of government are defined in the Declaration of Independance.

I don't believe this is the case. It does mention "Life, Liberty and the pursuit of Happiness" but the principles of government are not mentioned. It does contain a long list of grievances leading to the declaration but any mention of a right to privacy is totally absent.

Proper Government has no powers that an individual does not have simply because Government gets it's powers from the collective individuals.

Are you saying that an individual has the power to levy taxes and conscript an army? If not then I suppose you are saying that your government is not proper because it has the power to do both.

The Constitution is the enumeration of those powers and a proper law stays within the bounds of the constitution.

But your government has the power to amend the constitution.

Any law or enforcement that exceeds the limits of the Constitution is "unlawful" and tyranny, and therefore treason.

First of all, in American law, treason is defined as follows:

Treason against the United States, shall consist only in levying War against them, or in adhering to their Enemies, giving them Aid and Comfort. No Person shall be convicted of Treason unless on the Testimony of two Witnesses to the same overt Act, or on Confession in open Court.

And as I mentioned earlier, your government can amend the constitution as it …

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

All things considered, I don't see what use that xml file is. It doesn't have any information as to button text, placement or function. You really can't create anything useful without a lot of information that has to come from somewhere else. All that the file really tells you is that you need five buttons and you could replace all of the xml text with a file that contains "5" and nothing more.

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

So how do you give government the ability to change laws while at the same time restricting them from changing laws? We had a recent case here in Canada where the RCMP was found to have broken the law by destroying records (long gun registry) while an independent appeal was in process. The government's reaction was to retroactively change the law so that it, effectively, never existed to be broken. It's a horrible precedent but you can't remove the governments ability to pass laws and still have an effective government.

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

“The origin of science is in the desire to know causes; and the origin of all false science and imposture is in the desire to accept false causes rather than none; or, which is the same thing, in the unwillingness to acknowledge our own ignorance.” - William Hazlitt

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

You can't get that toolstrip from the given pseudo-xml. You might as well have posted

<Buttons>
    <tag>Some Buttons</tag>
</Buttons>
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about posting the xml and an example of what you want the tool strip to look like?

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

Also used, I hear, to hack into Kaspersky.

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

If you use Parameterized Queries then you don't have to worry about what delimiters to use.

Begginnerdev commented: Great tutorial +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could try to reference the file as

\\machine\D$\file.pdf

This assumes that the server has access to your PC using the admin share. If not then you may need to set up a share (probably read only) to a folder set up strictly for that purpose.

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

Science/medicine has to have impressive sounding terms for things. For example, sphenopalatine ganglioneuralgia is the technical term for brain freeze.

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

A TreeNode already has a Text property. Why do you want to add a TextBox?

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

I highly recommend The Dead Past a possibly prophetic short story by Isaac Asimov.

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

I would start by creating a class which has a string property for the question, a string list for the possible answers, and a property (your choice of type) that identifies which of the answers is the correct one. You could create a list (or Array) to contain the instances of your custom class. Unless you are talking about thousands of questions (all to be loaded at the same time) I think efficiency is irrellevent. Focus more on clear code.

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

Try

cmd.CommandText = "INSERT INTO POSITION " &
    "(positionID,stockSymbol,stockName,cashTransaction," &
    "lastUpdate,initialQuantity,initialValue,currentQuantity," &
    "currentValue,positionStatus)" &
    " VALUES (2,2,2,2,2,2,2,2,2,2)"

You don't need quotes around numeric values.

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

It's a small seven-legged marsupial.

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

When used as a single statement

iNumber = 1

assigns 1 to iNumber. When used as a conditional it evaluates to a Boolean which is actually 0 or -1 so

If IsNumeric(iNumber = 1) Then

will always evaluate to True no matter what number you compare iNumber to. One alternative is

Dim iNumber As Integer = 1
Dim sNumber As String = InputBox("Enter a number", "Numbers Only", iNumber)

If IsNumeric(sNumber) Then

    iNumber = CInt(sNumber)

    If iNumber >= 1 And iNumber <= 5 Then

        For i As Integer = 1 To iNumber
            Me.Controls("GroupBox" & i).Visible = True
        Next

    Else
        MsgBox("Enter only numbers from 1 to 5")
    End If
Else
    MsgBox("Enter only numbers from 1 to 5")
End If
ddanbe commented: Yes, of course. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I want to show all people who's called Andrea and in the some time is a cop (or something else)

If you want only cop then just do

SELECT * FROM tablename
 WHERE name LIKE '%Andrea%'
   AND occupation = 'cop'

but "(or something else)" implies you are interested in more than just cop.

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

The actual query would look something like

SELECT * FROM tablename
 WHERE name LIKE '%Andrea%'
   AND occupation IN ('cop','butcher','baker')
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's amazing that even after all the times he has been caught he still thinks he has credibility. I loved the segment that John Oliver did on Oz being grilled by congress.

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

A great moment from the original TV series, The Odd Couple, had Tony Randall filming a commercial for some medical thingy. He was wearing a lab coat and opened wth the phrase "Hello. I am a dramatization of a doctor." If only all commercials could be so truthful.

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

What I find amazing is that as we find our privacy rights being stripped by governments who have decided we shouldn't have any, we have to rely on organizations like Wikileaks to keep us informed as to what those governments are doing. A case in point is the recent revellations regarding the TPP.

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

That's what happpens when someone goes through the older posts (likely from doing a Search) and posts:

  • Thanks. Just what I was looking for
  • A follow-up question
  • An unrelated question
  • Something actually useful to the thread

Any reply at all bubbles the thread to the top of the list because they are sorted, not by when the thread was created but by the date and time of the most recent post. In most cases when a thread is 2-3 years old there is nothing further to add. When I see an old post which has been resurrected with a "thanks" I generally delete the post which pushes the thread back down the list.

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

I think your best bet would be Named Pipes. If both processes are on the same computer you can use a simpler method, Anonymous Pipes.

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

Unfortunately, for the free version I have to give up all control as to when updates are downloaded/applied. That just doesn't work for me because from mid May to mid September I am at the cottage where I pay extra for exceeding my bandwidth cap. If I go too much over the cap my service is automatically canceled. If I want the extra control I have to go Windows 10 Pro.

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

You should start by reading The Rules and this thread which appears at the top for a reason.

You started off on the wrong foot in several ways

  • You posted in ALL CAPS
  • You didn't provide a meaningful title
  • You didn't show that you have put any effort into solving the problem
  • You didn't give enough information for us to offer suggestions

Take the time to explain the problem you are having and show us what you have done so far.

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

You keep changing formats. First you said

Ani      | Human, my friend, boy

Now the format is

Ani #friend #human #male

The first thing you have to do is nail down a format. I'm guessing that what you have is a file like

Ani      | Human, my friend, boy
Car      | Vehicle, object with 4 wheels
Truck    | Vehicle, object with 4 wheels
Play     | Enjoyment
Man      | Human, male
Woman    | Human, female

That would be easy to parse. You could use Split on | to separate the word from the tags, then Split on , to separate the individual tags.

Based on that, when you type a tag into a textbox the program displays all words from the file that have that tag. For example, if you enter Vehicle, the program will display

Car
Truck

Is that correct?

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

It is the big compagnies who are affraid

Afraid? I don't think so. The big American Banks got royally caught blatantly breaking the law. How many execs went to jail or were even prosecuted? How many "famous" people go to jail for doing things that would land the rest of us behind bars? The rich (and/or famous) do not fear the light of day. They already have a get out of jail free card and seem to revel in their immunity from prosecution. It's the rest of us that have to be afraid.

that doesn't justify the need for so much privacy.

I'm not looking at it so much as a need as a right. Saying "how much do you need" puts the onus on the individual to constantly justify what is a basic right. If you look at the world like that then why not just do away with the idea of a search warrant? Instead, I'll just go to court every time I think of something I want to keep private.

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

I hate how cribbage boards always come with plastic (instead of metal) pegs that snap off in the holes within days.

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

seriously privacy isn't really that important if your not a crook.

Cheating on your wife does not make you a crook. Neither does being treated for herpes, aids or chronic depression. How many of these things would you like made ppublic?

the government may have hours of video of you cheating on your wife,but who cares

There are many instances of government information being used for purposes other than intended. What about an employee who has access to proof that you are cheating on your wife and decides to use that for financial gain? For every Edward Snowdon there may be hundreds of others who wouldn't mind supplementing their government salary. And let's not forget that larger and larger portions of intelligence gathering are being outsouurced to private companies that are more concerned with profit than the security of the information they are hosting.

But if your planning a bombing, they would stop you dead on your tracks.

Seen the recent reports of government agents easily getting prohibited weapons through the crackerjack airport security? How about the reports that show that most of the terrorist plots foiled by the FBI were actually cases of entrapment? How many terrorist plots have actually been foiled due to government spying on its own citizens?

Lets use social media as an example

I discount social media because the information that is posted there is deliberately shared. I have no cocern for the privacy rights of people …

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

Another oldie but goodie is a Canadian film, The Silent Partner.

A timid bank teller anticipates a bank robbery and steals the money himself before the crook arrives. When the sadistic crook realizes he's been fooled, he tracks down the teller and engages him in a cat-and-mouse chase for the cash.

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

Computer companies (ARE YOU LISTENING, DELL) that tout USB 3 speeds of "up to ... MBPS, then claim that these are "theoretical maximums" when USB 3 turns out to be little or no faster than USB 2.

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

@ddanbe - let's take a hypothetical. You frequent an adult book store, or perhaps a bar, or even make weekly visits to a psychiatrist/therapist. Every entrance/exit to these establishments is captured on camera. These activities are all perfectly legal but do you want a record of these visits kept? For the time being the images are anonymous unless someone actually reviews the video but what about when face recognition becomes universally used in conjunction with your drivers licence photos. Now, instead of nameless comings and goings the computer can automatically log every entrance/exit. At some point there will be a record of every step you take. There's a big difference between "someone might see me" and "there's a permanent record and eventually someone will see this".

It's a funny thing about the people who always tell us "if you haven't done anything wrong then you shouldn't mind...". These people whould be the first to object should we start snooping in their private affairs.

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

Rewatched an oldie but a goodie. Murder by Natural Cuses.

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

I wonder if the Americans realised what impact Bush Jr had on their credibility.

The smart ones did. Apparently Jeb Bush isn't one of them. He publicly stated he'd govern the same way his brother did.

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

Since the thread title is Health without being more specific, I thought I'd post this amusing commentary...

high_maintenance_large.jpg

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

I have a few unrelated suggestions.

You might want to replace the multiple declarations of prop## with

Private prop(30)

This would allow you to replace

prop01 = tbxProperty01.Text
lblProperty01.Text = prop01
prop02 = tbxProperty02.Text
lblProperty02.Text = prop02
prop03 = tbxProperty03.Text
lblProperty03.Text = prop03
prop04 = tbxProperty04.Text
lblProperty04.Text = prop04
prop05 = tbxProperty05.Text
lblProperty05.Text = prop05
prop06 = tbxProperty06.Text
lblProperty06.Text = prop06
prop07 = tbxProperty07.Text
lblProperty07.Text = prop07
prop08 = tbxProperty08.Text
lblProperty08.Text = prop08
prop09 = tbxProperty09.Text
lblProperty09.Text = prop09
prop10 = tbxProperty10.Text
lblProperty10.Text = prop10
prop11 = tbxProperty11.Text
lblProperty11.Text = prop11
prop12 = tbxProperty12.Text
lblProperty12.Text = prop12
prop13 = tbxProperty13.Text
lblProperty13.Text = prop13
prop14 = tbxProperty14.Text
lblProperty14.Text = prop14
prop15 = tbxProperty15.Text
lblProperty15.Text = prop15
prop16 = tbxProperty16.Text
lblProperty16.Text = prop16
prop17 = tbxProperty17.Text
lblProperty17.Text = prop17
prop18 = tbxProperty18.Text
lblProperty18.Text = prop18
prop19 = tbxProperty19.Text
lblProperty19.Text = prop19
prop20 = tbxProperty20.Text
lblProperty20.Text = prop20
prop01 = tbxProperty01.Text
lblProperty21.Text = prop21
prop22 = tbxProperty22.Text
lblProperty22.Text = prop22
prop23 = tbxProperty23.Text
lblProperty23.Text = prop23
prop24 = tbxProperty24.Text
lblProperty24.Text = prop24
prop25 = tbxProperty25.Text
lblProperty25.Text = prop25
prop26 = tbxProperty26.Text
lblProperty26.Text = prop26
prop27 = tbxProperty27.Text
lblProperty27.Text = prop27
prop28 = tbxProperty28.Text
lblProperty28.Text = prop28
prop29 = tbxProperty29.Text
lblProperty29.Text = prop29
prop30 = tbxProperty30.Text
lblProperty30.Text = prop30

with

For i As Integer = 1 To 30
    Dim seq As String = i.ToString("D2")
    Dim tbx As TextBox = Me.Controls("tbxProperty" & seq)
    Dim lbl As Label = Me.Controls("lblProperty" & seq)
    prop(i) = tbx.Text
    lbl.Text = prop(i)
Next

or, …

ddanbe commented: Exellent advice. +15