Begginnerdev 256 Junior Poster

Would something like this help?

Click Here

Begginnerdev 256 Junior Poster

I am hoping I don't get the odd person who says this isn't possible

This isn't possible! Just kidding! :)

Begginnerdev 256 Junior Poster

Is it possible that the message box breaks execution long enough for your buffer to catch up?

Begginnerdev 256 Junior Poster

One thing you may actually want to look at is drawing on the image itself. Is there a specific reason you want a lable? Will you be chaning text on runtime?

If not, you can draw over the image with something like this:

Using g As Graphics = Graphics.FromImage(PictureBox1.BackgroundImage) ' or .Image
    g.DrawString("Hello World", New Font("Times New Roman", 12), Brushes.Black, New Point(0, 0))
End Using

This would move with the image and resize with the image.

This would cause a problem in the long run if you wanted to change the text on runtime.

One idea could be to draw a Rectangle to hold the text (maybe with a white background) and then write the text over it.

Private Sub DrawRect()
    Try
        Using g As Graphics = Graphics.FromImage(PictureBox1.BackgroundImage) ' or .Image

             g.FillRectangle(Brushes.White, New Rectangle(0, 0, 70, 20)) '70 x 20 is usual size of a textbox
             g.DrawString("Hello World", New Font("Times New Roman", 12), Brushes.Black, New Point(0, 0))
        End Using
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

Does this give you a good starting point?

Begginnerdev 256 Junior Poster

It completely messes with my mind for some reason.

Must be my OCD.

Begginnerdev 256 Junior Poster

Is anyone else not freaked out about Fred's left hand?

It looks like his thumb is on backwards.

Begginnerdev 256 Junior Poster

To get the most accurate time used, you will have to read/write to the database every n seconds. This could be a performance hog but it can be done.

What is you time stored as in database? A string? (Text, NVarchar, Varchar, ect..)

Begginnerdev 256 Junior Poster

Oh boy! GDI+ error! Love GDI+ generic errors! (rolls eyes)

What does veiw details say?

Begginnerdev 256 Junior Poster

If you think of your screen as a quadrant, it would have the y axis reversed.
(X,Y)
0,0 | 1,0 | 2,0 | 3,0 |
0,1 | 1,1 | 2,1 | 3,1 |
0,2 | 1,2 | 2,2 | 3,2 |

This being said, you see a positive value in debug because you are viewing the values before the interpreter sees the '-'

Begginnerdev 256 Junior Poster

Do you receive an error when using Headers.add?

Begginnerdev 256 Junior Poster

As shown here; the TranslateTransform sets the new zero point of the drawing.

When you call this you are setting the new zero point to the center of the screen. (1/2 sz.Width, 1/2 sz.Height).

Therefore, when you tell it to draw the string at 5,6 it will draw using the new zero.

ddanbe commented: Nice. +14
Begginnerdev 256 Junior Poster

As per Microsoft's documentaion found here - that property is obsolete.

ReplyTo Obsolete. Gets or sets the ReplyTo address for the mail message.

A quick google session reveals you may be able to do this as follows:

message1.Headers.Add("Reply-To","a@a.a")
Begginnerdev 256 Junior Poster

It could be a limitation in their software.

Possibly a datasource not being release or plain ole memory leak.

Anything is possible when using 3rd party software.

Begginnerdev 256 Junior Poster

You will need to locate the ID of these controls and pass a value to them using javascript then fire the button click.

function setText(username,password){
var tbUserName = document.getElementById("UserNameTextBox");
var tbPassword = document.getElementById("PasswordTextBox");
tbUserName.value = username;
tbPassword.value = password;
}

Then call the javascript function from vb.net.

A full sample project can be found here.

Begginnerdev 256 Junior Poster

My week normally goes as follows:

Work - Most of the day
Gym - 1 hour 30 minutes
Social Life - What's left

Begginnerdev 256 Junior Poster

Sounds like your problem lies here:

Dim s As String = "SELECT * FROM pay_item_description WHERE [pay item]='" & str & "'"

If you change the code to :

Dim s As String = "SELECT * FROM pay_item_description WHERE [pay item]=" & Cint(str)

Or

Dim s As String = "SELECT * FROM pay_item_description WHERE [pay item]=" & CDbl(str)

What happens?

Begginnerdev 256 Junior Poster

I might suggest the HTML Agility Pack.

As for the website, how does it prompt for a login? with a popup window or standard textboxes and okay button?

Begginnerdev 256 Junior Poster

You can try writing a custom fill function:

Private Function Fill(ByVal lstIN As List(Of T)) As Boolean
    Try
        Dim lvi As New ListViewItem

        lvi.Text = lstIN(0) 'if index 0 is a unique - Column 1
        lvi.SubItems.Add(lstIN(1)) 'Column 2 in listview
        lvi.SubItems.Add(lstIN(2)) 'Column 3

        ListView1.Items.Add(lvi)

        Return True
    Catch ex As Exception
        Return False
    End Try
End Function
Begginnerdev 256 Junior Poster

After a quick google session I found a piece of software that claims to expose the functions in a dll.

See if this might help you in any way.

Beware! I did not download this software or try it. It could be legit or could be scam.

Begginnerdev 256 Junior Poster

This is begginning to sound a lot like a crystal problem and not a vb.net problem.

Have you contacted their support team?

Beware! Ask about a price (if any) or you may be hit with a "small" phenomenal fee.

Begginnerdev 256 Junior Poster

I doubt rockstar will allow some one to query their database. That being said, you can do a hidden browser control and pull those tags off.

You will have to look into the html to see what tags/controls you may be after.

Begginnerdev 256 Junior Poster

I'd say about 3-4 inches from chest.

We call that "butt to the grass"

Begginnerdev 256 Junior Poster

I am not sure about funny ring tones, but android allows you to set full songs at a ring tone.

Any purchased music that is downloaded to your SD card or phone can be set as a ring tone.

There are various pieces of software out there for Android that allow you to splice songs too.

Begginnerdev 256 Junior Poster

My routine usually goes as follows:

Average day:
Cardio(Running)
Compound Exercises(By Muscle Group)

Schedule:
Monday - Upper
Tuesday - Lower
Wednesday - Rest
Thursday - Upper
Friday: Lower
Saturday - Touch Up
Sunday - Rest

Chest/Arms:
Bench Press
-Flat
-Incline
-Decline

Curling
-Preacher curls
-Hammer
-Modified Hammer (Twist dumbell when 3/4 into contraction)

Bench Dips

Shoulders/Back:

Facepulls:
-Top down
-Face level
-Bottom up

Rows

Pulldowns
-Font (Bar touches chest)
-Back (Bar touches traps)

Legs:

Legpress:
-Warm up at 700
-3 sets of 15 reps at 1100
Squats:
-Warm up at 205
-3 sets of 15 reps at 450

Running to finish legs off

cproger commented: Wow +0
Begginnerdev 256 Junior Poster

Sorry, I typed the code into the editor.

Try wrapping the first half of the if with a Not IsNothing()

If Not IsNothing(ds.Tables("Login")) And ds.Tables("Login").Rows.Count > 0 Then
Begginnerdev 256 Junior Poster

The username/password window is popping up when you use a datareader?

Begginnerdev 256 Junior Poster

Try adding the Dll file to your project and use intuition to decalare some instances of the possible classnames inside. If the vendor has no documentation it will be extremely slow, but none the less, it could be a viable option.

If the application is written in VB6 you might have to work with interopt.

Begginnerdev 256 Junior Poster

After reading this code, I hope that this system is not being implemented in a corporate environment. This is horribly insecure - using some one's last name as a password will almost guarantee an easy data breach.

As for the code, why are you selected the contents of the entire table?

Just look for the contents by ID.

For example:

'Class wide variable
Dim iAttempts As Integer = 0


If iAttempts > 3 Then
    MsgBox("Login attempts have exceeded 3!")
    Exit Sub
End If

Dim da As New OleDBDataAdapter(New OleDBCommand("Select ID, LASTNAME, FIRSTNAME, LOGINSTATUS from Users WHERE ID='" & txtID.Text & "'",New OleDBConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Renz\Documents\Visual Studio 2012\FINAL\Database\AuditDB.mdb")))
Dim ds As New DatSet

da.Fill(ds,"Login")

If ds.Tables("Login") And ds.Tables("Login").Rows.Count > 0 Then
    If ds.Tables("Login").Rows(0)("LASTNAME") Then
        If txtPassword.Text = "admin" Then
            'Staff
            iAttemtps = 0
        Else
            'Student
            iAttempts = 0
        End If     
    Else
        MsgBox("Password was incorrect!")
        iAttempts += 1
    End If
Else
    MsgBox("Could not find ID!")
    iAttempts += 1
End If
saintrenz commented: Error 1 Operator 'And' is not defined for types 'System.Data.DataTable' and 'Boolean'. +0
Begginnerdev 256 Junior Poster

Just use the my.Resources._1 call to get the path:

   Dim sDest As String = My.Computer.FileSystem.SpecialDirectories.Desktop
   My.Resources._1.Save(sDest)
Begginnerdev 256 Junior Poster

Is the above image from a website or an existing application?

Begginnerdev 256 Junior Poster

If you are dealing with large amounts of data, you will have a hard time "optimizing" this. You may also want to try a DataReader. They will only grab the data, but not store it in local memory.

Begginnerdev 256 Junior Poster

Does the application have non os libraries? For example: Something that was copied and registered when the application is installed?

Begginnerdev 256 Junior Poster

What error does the Connection.Open() method throw?

You can do a try/catch with a msgbox to find out:

Try
    con.Open()
Catch ex As Exception
    MsgBox(ex.ToString())
End Try
Begginnerdev 256 Junior Poster

Yes, it is just as simple.

Look Here

Begginnerdev 256 Junior Poster

Something as simple as:

Dim sr As New StreamReader("PAthtofile")
While sr.Peek <> -1
    Console.Out.WriteLine(sr.ReadLine)
End While
Begginnerdev 256 Junior Poster

How are you connecting inside your application?

Generally if you wrap your connect code in a try/catch a problem will be thrown.

Have you check your connection string?

Begginnerdev 256 Junior Poster

You could fill a dataset in code and pass it to crystal if you wanted to skip using a odbc.

See this article for programmaticly setting the datasource for crystal.

See this article for filling a DataSet.

Begginnerdev 256 Junior Poster

Have you read this article?

Begginnerdev 256 Junior Poster

Are you trying to add multiple cells in a single row?

Dim lvi As New ListViewItem

With lvi
    .Text = "Column1"
    .SubItems.Add("Column2")
    .SubItems.Add("Column3")
    .SubItems.Add("Column4")
End With

ListView1.Items.Add(lvi)

If you are wanting to add a column to the listview try:

ListView1.Columns.Add("ColumnName")
Begginnerdev 256 Junior Poster

Here is a lengthy article on Serial/Parallel port programming in vb.net.

Have you contacted the equipment manufacturer to see if there is some API that you can use?

Begginnerdev 256 Junior Poster

When stepping though the code which part is showing null?

DtSet or Data1?

Begginnerdev 256 Junior Poster

With microsoft's migration to Outlook.com I would not be so sure the hotmail host is online, they could have migrated to a new server / ip as well.

Begginnerdev 256 Junior Poster

What language is the code posted above?

As far as conversion, why are you BLINDLY Converting to VB.NET?

Begginnerdev 256 Junior Poster

What database backend are you using?

If it is SQL, you can look for the dates using a select - between statement:

"SELECT Count(*) As Count From Table1 WHERE (Date1 BETWEEN '" & Date1 & "' AND '" & Date2 "') OR (Date2 BETWEEN '" & Date1 "' AND '" & Date2 & "')

Just check the value of Count on the return and prompt your user if there is a reservation in that time period.

Begginnerdev 256 Junior Poster

On what line of code is the null reference being thrown?

Begginnerdev 256 Junior Poster

Try changing your fill statement to incorporate a table name:

adpt.Fill(DtSet,"Data1")

Now you can access the table like so:

IF Not IsNothing(DtSet.Tables("Data1")) And DtSet.Tables("Data1").Rows.Count > 0 Then
    'Do work
End If
Begginnerdev 256 Junior Poster

You will want to load the data into a datatable to get the corresponding information.

If the Item_Stock field holds the quantity you just need to select it and get the value from the adapter.

For example:

Dim da As New OleDBDataAdapter(New OleDBCommand("SELECT Item_Stock FROM tbl_Products AS Qty WHERE Item_Name='" & cbo_Items.Text & "'",New OleDBConnection("MyConnectionStringHere"))
Dim ds As New DataSet

da.Fills(ds,"Quant")

If ds.Tables("Quant").Rows.Count > 0 Then MsgBox("Current count is:" & ds.Tables("Quant").Rows(0)("Qty"))
Begginnerdev 256 Junior Poster

I copied the code into a blank project and created what I assume to be the form and I can see part of your problem is that you allow the user to press the play button when the counter is already to zero.

You will need to disable the play button when the counter hits zero.

For example:

If intCounter > 0 Then
    intCounter -= 1

    If intEnterNum <> ranNum Then
        If intCounter > 0 Then
            MessageBox.Show("Wrong guess again. You have " & intCounter & " chances left.")
        Else
            txtbxEnterNum.Enabled = False
            If MessageBox.Show("Game Over", "Try Again", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then btnReset.PerformClick()
        End If
   Else
       If MessageBox.Show("Correct! Do you wish to restart?", "Please Confirm Action", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then btnReset.PerformClick()
   End If
End If

Now change your btnReset_Click sub to look something like:

Private Sub btnReset_Click(sender As System.Object, e As System.EventArgs) Handles btnReset.Click
    txtbxEnterNum.Clear()
    txtbxEnterNum.Enabled = True
    ranNum = 0
    intCounter = 3
End Sub
Begginnerdev 256 Junior Poster

Do you have the image inside a panel? Or maybe in PictureBox?

Something that has a Resize event can be used to compute change amount.

You could also look at using mousedown and mouseup as well. These would only change the label size when the user released the mouse button.

Here is an article that may help you with the logic.

Begginnerdev 256 Junior Poster

Try changing your class to have a new instance of List(Of Student)

For example:

<Serializable()> _    
Public Class LessonPlans
    Private lstStudents As New List(Of Student)
    Public Property Teacher As String
    Public Property RoomNumber As String
    Public Property Subject As String
    Public Property Students As List(Of Student)
    Get
        Return Me.lstStudents
    End Get
    Set(value As List(Of Student)
        Me.lstStudents = value
    End Set
End Class

This may be the compilers best way of dealing with an uninstantiated list.