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

I get periodic pop-ups from a company called Scorecard Research asking me to complete a survey. This only happens when I am on Daniweb. is this legit? If so then how can I make it go away? The questions were innocuous so I answered them but the pop-up keeps coming back. Fortunately it is only once every few days.

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

I think it would be more useful if the validator could indicate the line or lines that have been flagged as invalid.

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

Don't disable the label. Replace your code with

Dim lblPrtNo As New Label()
lblPrtNo.Name = "lblPrtNo"
lblPrtNo.Text = "Part Number"
lblPrtNo.BackColor = Color.DarkBlue
lblPrtNo.ForeColor = Color.White
lblPrtNo.Font = New Font("Sans Serif", 9, FontStyle.Bold)
lblPrtNo.Location = New Point(15, 56)
lblPrtNo.Size = New Size(77, 15)
pnlOrderLine.Controls.Add(lblPrtNo)

and it will work the way you want.

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

I'm playing with it right now. In the meantime I'll mention that you shouldn't add the controls to both the panel and form collections. The form contains the panel control and the panel control contains the label and text controls.

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

It depends what the relationship is. You can relate tables based on any field.

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

If you want the controls in the panel then you have to add them to the panel controls collection instead of the form controls collection as in

pnlOrderEntry.Controls.Add(lblPrtNo)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I've never used the Friend declaration and I've never had a problem. I also don't use the With Events option. That doesn't mean I am doing it correctly.

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

Keep in mind that if you want to reference the controls other than from within the event handlers, you will need a variable to hold that reference. If you are creating an array of textboxes then Ii suggest you use an array to save the references. As tinstaafl says, declare the array at the class level as

Private TxtRefs(10) As TextBox
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

At line 34 you have

Me.Controls.Add(txbPartNo)

but you don't have an End Sub before the next statement. On my system (VB 2010), the statement

txbPartNo.TextAlign = ContentAlignment.MiddleLeft

is not valid. When I remove it and add the End Sub the code works fine. And just out of curiousity, why do you need a TextChanged event handler for a label control?

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

6081

And not even one piece of (c)rap.

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

My in-laws are pretty old. After a recent snowstorm, some neighbour kids came over, shoveled their driveway, then left without going to the door. They weren't asked to come over and they didn't ask for payment or even recognition. The only way my in-laws knew who had done the shovelling was by the trail of footprints they left behind. Apparently there are still some parents left who instill good values in their children.

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

For those of you familiar with Chuck Lorre's productions, you are probably aware of the vanity cards that flash briefly at the end of each show. Some are censored by the network and available only on his website. There is a recent one that he didn't even bother to submit to the censors for approval. I think it should be read by everyone. You can find card # 397 here

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

You can also download (free) the SQL Management Studio which greatly simplifies the creation and management of databases. However, installing it is tricky unless you follow the step by step instructions

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

In my textbox the text scrolls to the left as I type when there are more characters than can be displayed. I don't have to do anything special.

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

Try creating the two tables from my example above. EmployerID and EmployeeID are IDENTITY fields. You don't supply a value when you insert a new record. The value is generated by the database engine. You do, however, have to supply a value for EmployerID when you insert a new record into the Employee table. Because Employee.EmployerID was created with a foreign key constraint, any attempt to add an Employee record with a non-existing EmployerID will fail. A foreign key, therefore, cannot be NULL. The following command creats the constraint

ALTER TABLE [dbo].[Employee] WITH CHECK ADD CONSTRAINT [FK_Employee_Employer] FOREIGN KEY([EmployerID])
REFERENCES  [dbo].[Employer] ([EmployerID])
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Rake some leaves, shovel some snow, wash somebody's car or walk their dog. You can make 9$ doing just about any trivial chore. It doesn't take a lot of imagination.

AndreRet commented: How the old school works!! work for your cash or be broke, ;) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Why do you have both EmployerID and IDEmployer in the Employee table and why do you allow NULLs in IDEmployer?

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

For example. If I have two tables

USE [mydb]
GO

/****** Object:  Table [dbo].[Employer]    Script Date: 02/17/2013 06:40:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Employer](
    [EmployerID] [int] IDENTITY(1,1) NOT NULL,
    [LastName]   [varchar](50)       NOT NULL,
    [FirstName]  [varchar](50)       NOT NULL,
 CONSTRAINT [PK_Employer] PRIMARY KEY CLUSTERED 
(
    [EmployerID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

and

USE [mydb]
GO

/****** Object:  Table [dbo].[Employee]    Script Date: 02/17/2013 06:40:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Employee](
    [EmployeeID] [int] IDENTITY(1,1) NOT NULL,
    [LastName]   [varchar](50)       NOT NULL,
    [FirstName]  [varchar](50)       NOT NULL,
    [EmployerID] [int] NOT NULL,
 CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED 
(
    [EmployeeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Employee]  WITH CHECK ADD  CONSTRAINT [FK_Employee_Employer] FOREIGN KEY([EmployerID])
REFERENCES [dbo].[Employer] ([EmployerID])
GO

ALTER TABLE [dbo].[Employee] CHECK CONSTRAINT [FK_Employee_Employer]
GO

then I can do

SELECT Employer.FirstName,Employee.FirstName
  FROM Employer INNER JOIN Employee ON Employer.EmployerID = Employee.EmployerID

or

SELECT Employer.FirstName,Employee.FirstName
  FROM Employer,Employee
 WHERE Employer.EmployerID = Employee.EmployerID
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You have two fields in your Employee table. They both look (by name) like they contain the Employer ID. If you are going to show me the tables then please show all fields. Your primary key for the Employee table should not be EmployerID.

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

Try SERVER\SQLEXPRESS (back slash). When I connect to the SQLEXPRESS on my computer I use

JIM-PC\SQLEXPRESS

If you are connecting to a SQLEXPRESS on another machine then you will have to check that you have been granted access rights for you as currently logged on. If not then access rights will have to be set up (because you are using integrated security). Or you can use a userid/password that has been set up in SQLEXPRESS in which case you will have to specify the userid & password in the connection string.

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

A minor suggestion. Assuming you are using radio buttons then you can simplify your code because if (for example) the male button is not selected then the famale buttom must be selected. So instead of

If (maleRbtn.Checked = True) Then
    gender = 0
ElseIf (femaleRbtn.Checked = True) Then
    gender = 1
End If

you can write

gender = IIF(makeRbtn.Checked, 0, 1)

or if you have defined consts for MALE and FEMALE you can do

gender = IIF(makeRbtn.Checked, MALE, FEMALE)

which is clearer.

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

In order to relate two tables they have to have a common column. You'll have to include the EmployerID as a column in the Employee table. You described the tables as follows:

Employer Table:
I have two field
EmployerID (pk Key assigned to it)
Employee Table:
EmployerID(pk Key assigned to it)
IDEmployer(fk key assigned to it,and Allow Nulls:Checked)

You said the Employer table has two columns but I see only one. The Employee table has only two fields and both look like the EmployerID. Set the tables up as follows (add more columns as needed)

Employer
EmployerID (PK)
LastName
FirstName

Employee
EmployeeID (PK)
LastName
FirstName
EmployerID (FK)

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

I could be wrong, but is'nt "Persist Security Info" a parameter for connecting to SQL Server and not an old Access mdb file?

That's why I asked what type of database was being accessed. If the parameter is not valid for that type of database then you can get the error.

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

The female (Ika) was played by Rae Dawn Chong, daughter of Tommy Chong of "Cheech and Chong". The grunts are an actual language created by Anthony (Clockwork Orange) Burgess. David Prowse (the man in the Darth Vader suit) auditioned for this movie. He also appeared in A Clockwork Orange.

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

This error can happen when you have a parameter in your connection string that is not valid for the given provider. Try changing

Persist Security Infor=False

to

Persist Security Info=False

and see what happens. What type of database are you trying to open?

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

I did. I wrapped some tinsel around my willy.

Don't try that in Colorado. They passed a law a few years ago outlawing aluminum (aluminium for you) underpants. Apparently people were stuffing merchandise with RFIDs in there to shoplift past sensors.

AndreRet commented: OR to avoid kidnapping by aliens ;) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This thread was marked as solved five years ago.

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

Antidepressant use in the United States has nearly quadrupled in the last twenty years. Those states identified as being the most religious are also the heaviest per capita users. Residents of Utah are twice as likely as Americans over all to be users of anti-depressants. Of the top ten religious states, six are also on the list of top ten most medicated states

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

I think you can clear out saved text by clicking the dropdown box and moving the cursor over an option. When it is highlighted, press the DELETE key.

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

How are you making out with the script?

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

I don't know what the above link has to do with this thread but because my issue was resolved then I'm going to mark this thread as done.

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

I'll give you the same advice that was given to me. Disable all plugins and restart your browser. If that fixes the problem then one of your plugins is at fault. Enable them one at a time until you figure out which one it is.

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

Here's an oldie but a goodie. Back in the days when hard drives were small (20 meg was about the standard), a third party app called DoubleSpace was sold to do on-the-fly compression/decompression. It also managed space with much less waste than FAT. Typically, if you had a 20 meg drive, after installing DoubleSpace the size showed as roughly 40 meg. Double space did this by allocating one file with a name like dblspc.bin which took up the entire drive.

I recall a question from a reader in Byte magazine. The question went something like "I have a 20 meg hard drive and after installing DoubleSpace it says I now have 40 meg. There is a file on my drive named dblspc.bin which says it is 20 meg in size. If I delete this file will I get another 20 meg of free space?"

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

Which index is it complaining about? You have two

  • currentTimer - 1
  • List.Items(currentTimer - 1).SubItems.Count

Try replacing the code with

Debug.WriteLine("index 1 = " & (CurrentTimes - 1).ToString)
Debug.WriteLine("index 2 = " & (List.Items(currentTimer - 1).SubItems.Count).ToString)
Debug.WriteLine("# items = " & List.Items.Count)
List.Items(currentTimer - 1).SubItems(List.Items(currentTimer - 1).SubItems.Count).Text = ""

The obvious problem is that you are either indexing past the number of items or past the number of subitems. You can't determine that just by looking at the code. You have to see the actual values of the indices.

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

You can try uninstalling the ones you seldom use, however, in my experience uninstalling still leaves around a lot of crap on the drive and in the registry. You might want to just reinstall Windows. I don't know your capabilities but this is how I typically configure

  • 60 gig C partition (for OS and apps)
  • remaining space as D partition (for data)
  • format C and install Windows
  • install core apps
  • install imaging software
  • apply all Windows updates
  • take an image of C

I use Acronis for imaging. This is a paid app but if you want free I highly recommend Macrium Reflect. I install/uninstall a lot of software for evaluation and when my system starts to bog after 6 months or so I just reinstall the image, apply the outstanding updates, then take a new image.

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

You couldn't even be bothered to make a decent title. I would have deleted this post if others hadn't already replied. I'll just let it stand as a good example of a bad example.

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

Don't expect anyone here to write this for you. We offer help and advice.

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

Please display the value of sqlupdate (Debug.WriteLine would be good) and post the results here. And before someone else says it, you should be using parameterized values instead of just concatenating to create your query.

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

Show us what you have so far. If you don't have anything then it's time to do some research. Use google to find some tutorials (there are several good ones) or get a book.

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

This thread is for code snippets. Please post this as a regular forum thread and I will be happy to respond. Please include the code from the entire section (Function or Sum) and please indicate what line is causing the error.

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

For numeric input I suggest you use a NumericUpDown control. It will accept only numbers and you can set maximum and minimum values for the control (and alter them at runtime).

You set the messagebox style to Critical or YesNoCancel but only ever check for Yes, No or Cancel. Try setting it up as follows:

Select Case MsgBox(msg, MsgBoxStyle.YesNoCancel, title)

    Case MsgBoxResult.Yes
        .
        .
        .
    Case MsgBoxResult.No
        .
        .
        .
    Case MsgBoxCancel
        .
        .
        .
End Select    

You retest where it is not necessary. Your code basically looks like

If num = x Then
    .
End If

If num < x Then
    .
End If

If num > x Then
    .
End If

If the first case is true then you don't need to do the following two tests. Using the NumericUpDown control with a Select Case gives you

Select Case NumericUpDown1.Value

    Case Is = X
        Me.Text = "you guessed it"

    Case Is < X
        Me.Text = "too low"

    Case Is > X
        Me.Text = "too high"

End Select
Begginnerdev commented: True +8
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Then again, our (Canadian) system has its abuses such as when the current government has the audacity to say publicly that there is really no point in debating government motions because they have a majority and will pass them regardless. And what little checks and balances as are provided by the Senate disappear when the sitting government just appoints enough senators to achieve a majority in that house.

I agree with Mike that instant run-off voting would do a lot toward making elections in this country more representative of the people's wishes. When the Prime Minister says "you won't recognize Canada once we're through with it" you just know the ride will be unpleasant. I also recall that he said that after he was elected, not while he was running.

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

We cook a special Valentine's Day meal together. Lobster, shrimp, cheese fondue, stir fry, etc.

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

And Godwin's Law holds true yet again. FDR was a visionary leader. Would you like to compare him to Hitler as well?

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

So, you would give more weight to sparsly populated areas then to densly populated areas?? That doesn't make much sense. IMO the EC should just be abolished and get rid of that headache.

I didn't propose any changes to the current system. Stop putting words in my mouth and go back and read my posts. All I claimed was that the GOP would try to change the current system because the current system is no longer working for them.

Election of the President by popular vote only. Whoever gets the most popular votes nationwide gets elected.

I think this is fair.

Every voter in every state gets the same vote as every other voter.

Except in red states where the GOP has suppressed Democratic votes.

I would like to think electronic voting could be implemented,

I think the only way electronic voting could work (and be seen to work) is to use machines for candidate selection (where the candidates are presented in an uniform and unambiguous manner), then have the machine print out a ballot with the selected candidates clearly marked. This ballot could be checked by the voter to ensure it was marked correctly. The voter woould then take that ballot and feed it into another machine which would tally the selections and save the ballot so it could be manually checked in the event of a recount.

Checks and balances.

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

CBeebies (Very Small Children's BBC).

That would make it the BaByC instead of the BeeBeeCee

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

How would that solve the problem of voter fraud?

You are still missing my point. The Republicans are not interested in eliminating voter fraud because voter fraud is not the problem that they say it is. What they are doing is using voter fraud as a rallying cry in order to disenfranchise the voters in demographics thay typically vote Democrat.

And I will say again, I never claimed that the GOP is trying to eliminate the Electoral College. Doing so would still have resulted in an Obama win. However, by "reforming" the way that EC votes are allocated would have resulted in a Romney victory in 2012.

That can't happen, it would require a constitutional amendment to eliminate the electorial college system

Again, please read my posts carefully. I said nothing about eliminating the EC. However, "reforming" the way the EC votes are allocated can be done by each state and does not require a constitutional amendment (as you pointed out is the case for Maine and Nebraska).

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

The point is not whether or not voter fraud exists. It does. However, every investigation, even those carried out by Republicans, has shown voter fraud to be extremely low. The point is that only one party is screaming "votor fraud" and using it to suppress legitimate votes. And the votes that are being suppressed are those in areas that are heavily Democratic. That is fraud and it affects millions of people. The GOP has repeatedly shown it is not above taking any measures to steal elections. They've user Gerrymandering, disenfranchisement and out and out lying. So my point was that the next logical step is to "reform" the electoral college under the guise of making it more democratic. Given what they've already done, don't you believe they are capable of that?

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

Please start a new thread and post the result of

Debug.WriteLine(query)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It is a fact of life that at some point, something critical will fail.

I keep my OS on my C partition and my data (except for transient) on other partitions/drives. I do a clean install on C, set up my core apps and apply all updates. Then I take a complete image of the C partition with Acronis (Macrium Reflect is a decent and free alternative). When my system gets boggy after months of abuse I restore the last image, apply all updates, then make a new image. I do regular data backups of all other partitions/drives (redundant backups - two copies of everythng on identical external drives). I also keep a log file in which I record the dates and times of all system changes (installed/removed apps, etc).