Netcode 33 Veteran Poster

I still don't believe in his cause.He had no right to do that and even if he had something to tell the world or some sort of publicity, please there are ways of letting your opinion known and not just known but count. Now that he has made himself clear by releasing the book and causing world alert, his revolution is a dead one because no one would follow.

Netcode 33 Veteran Poster

You may have isues with backward compatibility as debasidas stated, especially if you have reports and Microsoft Report Viewer used in the previous application

Netcode 33 Veteran Poster

Use the PrintDcoument class or

Netcode 33 Veteran Poster

Thanks luc001. i guess it was a typo. hope it solves Yousha's problem

Netcode 33 Veteran Poster
Private Sub New_User_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'declare variables
      Dim randomvalue As New Random   'create random object
      Dim randomhold As Integer
  
   'generate random number
            For i As Integer = 0 To 9999
                randomhold = randomvalue.Next(1, 9999) + DateTime.Now.Minute +                  DateTime.Now.Year
                txtUserId.Text = randomhold
            Next
End Sub
Netcode 33 Veteran Poster

why do you have a datetimepicker and a textbox? you can just use the value or text property of the datetimepicker.

Netcode 33 Veteran Poster

pls always remember to mark thread as solved when you've finally got a solution

Netcode 33 Veteran Poster
Private Sub Textbox1_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Textbox1.TextChanged

if IsNumeric(TextBox1.Text) THen 
   'do nothing 
else 
   'display error message
   messagebox.show("Numbers Only", "Error")
   'clear textbox 
TextBox1.Text = ""
End If
Netcode 33 Veteran Poster
If Me.txtLine2Rcon.Text = "" Then MsgBox("Please insert a running condition for Line 2 before you add it to the database", vbOKOnly)
exit sub 'this is to leave the sub procedure and prevent further code execution
Netcode 33 Veteran Poster

write the codes under the 'checked' procedure of both radio buttons

Netcode 33 Veteran Poster

simply use:

Textbox1.text = Now.Date
Netcode 33 Veteran Poster

for time:

textbox1.text = TimeOfDay.ToShortTimeString

for date:

Today.ToShortDateString()
Netcode 33 Veteran Poster

syntax errors. avoid too much use of unnecessary procedures.

Netcode 33 Veteran Poster
Private Sub ToggleMenus()
        Try

            'Declare a TextBox object and set it to the ActiveControl
            Dim objTextBox As RichTextBox = Me.ActiveControl
            'Toggle the Undo menu items
            tsmUndo.Enabled = objTextBox.CanUndo

            'Toggle the Cut toolbar button and menu items
            tsmCut.Enabled = objTextBox.SelectionLength

            'Toggle the Copy toolbar button and menu items
            tsmCopy.Enabled = objTextBox.SelectionLength

            'Toggle the Paste toolbar button and menu items
            tsmpaste.Enabled = My.Computer.Clipboard.ContainsText

            'Toggle the Select All menu items
            tsmSelectAll.Enabled = _
            objTextBox.SelectionLength < objTextBox.Text.Length
End Sub 

 Private Sub tsmCut_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsmCut.Click
        ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
        Dim objTextBox As RichTextBox = Me.ActiveControl
        'Copy the text to the clipboard and clear the field
        objTextBox.Cut()
    End Sub

    Private Sub tsmCopy_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsmCopy.Click
        ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
        Dim objTextBox As RichTextBox = Me.ActiveControl
        'Copy the text to the clipboard and clear the field
        objTextBox.Copy()
    End Sub

    Private Sub tsmPaste_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsmpaste.Click
        'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve information from the clipboard.
        Dim objTextBox As RichTextBox = Me.ActiveControl
        'Copy the text to the clipboard and clear the field
        objTextBox.Paste()
    End Sub
Netcode 33 Veteran Poster

its a default styling in visual studio. it shows the button has the focus

Netcode 33 Veteran Poster

why not make your search in the same format as in sql server
in order to avoid errors

Netcode 33 Veteran Poster
textbox1.text= combobox1.selecteditem.tostring
Netcode 33 Veteran Poster

first, the variable has to get its value from an input source, maybe a text box
so why not do something like this

"SELECT Product_Name FROM tb_ProductInformation" & _
WHERE Product_Name Like "'+ textbox1.text+'"
Netcode 33 Veteran Poster

instead, make a relationship between both tables.

Netcode 33 Veteran Poster

chris, first you need to make a connection to sql server and then you can access the particular dbase and rable from which you want to perform user verification as in my codes below

Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click

        Try

            'variable to hold connectionstring 
            Dim objconnection As SqlConnection = New  _
                 SqlConnection("Server=localhost;Database=MSS;" & _
                    "user ID = sa; password = clement;")

            objconnection.Open() 'open connection to server 

            'this is the SQL select statement query that is performed
            ' to read the username and password from server 
            Dim SelectStmt As String = "SELECT * FROM Login WHERE User_Name ='" + txtUsername.Text + "' and " + _
                                "Password ='" + txtPassword.Text + "'"

            Dim objcommand As SqlCommand = New SqlCommand(SelectStmt, objconnection)
            
            Dim reader As SqlDataReader = objcommand.ExecuteReader

            If reader.Read Then

                              Me.Dispose()


            Else

                'integer variable to count the number of times
                'the user has tried loggin in
                Static count As Integer = 0

                'display promt 
                Dim prompt As DialogResult = _
                MessageBox.Show("Invalid Username or Password!", "Login Error", _
                MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning)

                Select Case prompt

                    Case Windows.Forms.DialogResult.Retry
                        'keep login displayed for another trial 
                        txtUsername.Text = ""
                        txtPassword.Text = ""

                        count += 1 'increment counter by one 
                        If count = 3 Then
                            MessageBox.Show("High value of failed login attempts" & vbCrLf & _
                                           "Application will be terminated" & _
                                        " for security reasons", "Error", MessageBoxButtons.OK, _
                                        MessageBoxIcon.Stop)
                            End 'terminate application
                        End If

                    Case Windows.Forms.DialogResult.Cancel
                        Application.Exit()  'terminate application

                End Select

            End If
        Catch ex As Exception

        End Try
    End Sub
Netcode 33 Veteran Poster

explanation of my code:
localhost- means the sql-server exists on the local machine (your system)
database- the name of your database in sql-server
user id - the id used in loggin into your sql server
password- password to login into sql server

voila

Netcode 33 Veteran Poster
Dim objConnection As New SqlConnection _
            ("server=localhost;database= dbase-name;" + _
             "user id= id;password= @password;")
Netcode 33 Veteran Poster

you dont need a liscence to sell ur program written in VB. all u need is to buy a liscenced visual studio to enable create robust applications. You can get the free edition from Microsoft website which is the Express Edition

Netcode 33 Veteran Poster
DATE: TEXTBOX1 = Date.Now.month & "/" & Date.Now.day & "/" & Date.Now.Year
TIME: TEXTBOX2 = Date.Now.ToShortTimeString
DAY: TEXTBOX3 = Date.Now.ToShortDateString
Netcode 33 Veteran Poster

it sure wont work. the .exe file is more like a compiled copy of your program and definitely when it runs, its gonna search for your MS Access database, when it does not find it, it gives you the error