lolafuertes 145 Master Poster

I will try the following:
1) Mount the disc as secondary in another PC
2) Fully scan it vith a current antivirus.
3) Run a CHKDSK /R on it to find any error an repair (if possible)
4) On the original PC verify if it runs now
5) If not, try a repair from the original Windows CD
6) if none of this is works y a new disk, install from scratch, add the old disc as secondary and copy all the relevant info to the new disk. Then you can format the old and recover it. :)

lolafuertes 145 Master Poster

You can simulate a router using your PC with some server or professional version of windows or using Linux, while putting more than one lan card (10$ each) in the PC.

Better if you can find almost 3 PCs, old, cheap (max 100$), to do it. And of course 2 small switches (30$ each)

Then tou can play in the concepts of IP networks, sublans, VPNs, Firewalls, routers, bridges using the starndard utilities provided with the OS.

When the conceps are clear is easier to lern a language (like Cico IOS) ) to do it.

Hope this helps
Hope this helps

lolafuertes 145 Master Poster

Just be carefull when operating values.

An string can not be included in any math operation.

On your piece of code you must change som things:

Imports System.Data.OleDb

Public Class Form6
    Dim conn As OleDbConnection
    Dim cmd As OleDbCommand
    Dim strSQL As String
    Dim dr As OleDbDataReader


    Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database1.mdb")
        conn.Open()
    End Sub

    Private Sub enter6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles accept6.Click
      
        strSQL = "UPDATE ATM SET Balance_Inquiry = '" & Val(TextBox1.Text) - Val(Form4.balance.Text)
      
        If Val(TextBox1.Text) - Val(Form4.balance.Text) > Val(TextBox1.Text) Then
            MsgBox("Your Balance is insufficient to withdraw")
            TextBox1.Text = ""
            TextBox1.Focus()
        ElseIf Val(TextBox1.Text) < Val(Form4.balance.Text) Then
            Form4.balance.Text = (Val(Form4.balance.Text) - Val(TextBox1.Text)).ToString
            Me.Hide()
            Form8.Timer1.Enabled = True
            Form7.Show()
        End If
        cmd = New OleDbCommand(strSQL, conn)
    
    End Sub

Hope this helps

lolafuertes 145 Master Poster

I'm confused.
Do you find all the items added to the list box in the listbox.items collection?

Just to debug, add a msgbox lstStatus.Items.Count after adding the txt to verify if the counter increases.

Please let us know the results

lolafuertes 145 Master Poster

You can enable the groupbox and disable all their controls but the one to be enabled.

Hope this help

lolafuertes 145 Master Poster

Maybe you can try some thing like:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Static iPassCount as Integer ' thiss will assure that the counter is visible only locally but not lost from call to call
If TextBox1.Text = "students" And TextBox2.Text = "amaer" Then
Dim a As New Form2
a.Show()
iPassCount = 0 ' If passwor is ok then reset the counter
Me.Hide()
Else
iPassCount +=1 ' increase the counter
if iPassCount < 4 tehn ' while less than 3 retries notify the user
If MessageBox.Show("Please enter a valid Username and Password.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning) Then
End If
Else ' almost 3 times failed to enter the password
   ' Kill it?
End If
End If
End Sub

Hope this helps

lolafuertes 145 Master Poster

GDI+ is used to draw. If you need some special paintings for the 'image' to show in your control that is good.
If you need to create some controls with 'unusual' forms, maybe you need to go for WPF.

To know better about GDI+ start reading:
http://www.codeproject.com/KB/GDI-plus/GDI_.aspx (info about the API)
http://www.c-sharpcorner.com/uploadfile/mahesh/gdi_plus12092005070041am/gdi_plus.aspx (how to use from C#)

Keep reading the FAQ from http://www.bobpowell.net/faqmain.htm

Then goto http://msdn.microsoft.com/en-us/library/aa289159(VS.71).aspx

Hope this helps

lolafuertes 145 Master Poster

Two possible issues.
1) When installing/configuring the server you allowed to access to all system, instead of only to the desired foldeer
2) The sshuser has permission (direct or indirect) to the root of C: drive. In example, all 'Authenticated users' have permissions to create folders below C:\ and all the permissions except Change permissions, Take ownership and Delete subfolders and files. If the sshuser user will be authenticated (accepted by the logon) he will have the permissions.

Hope this helps

lolafuertes 145 Master Poster

Just be aware that this works only on NTFS drives.

And never on removable drives.

Hope this helps

lolafuertes 145 Master Poster

This may happen because the INSERT sentence in the procedure fails for any reason and you do not trap the error at store procedure level, raising an error if the insert fails.

Can you also put the table definition, indexes, triggers, defaults, permissions, etc and also the values passed to the stoed procedure inorder to try to verify where the problem is?

lolafuertes 145 Master Poster

Inorder to reflect the added items try

Public Sub SetStatus(txt as string) as string
lstStatus.Items.add(txt)
lstStatus.Refresh
System.Windows.Forms.Application.Doevents() ' gives time to refresh the screen
End Sub

Hope this helps

lolafuertes 145 Master Poster

In order to debug where the problem is, I will suggest:
1) Just before the ExecuteNonQuery take the Command string content and paste it into a new View (using SQL) in the Access DB and try it. If there is any syntax error ACCESS will help you do find where.
2) Do not surround with apostrophes the numeric fields
3) If there is a date field, be careful with the format passed to ACCESS

Hope this helps

lolafuertes 145 Master Poster

Be carefull when comparing. In your code, if TextBox1.Text contains "10" and Form4.balance.Text contains "2", the sentence

If TextBox1.Text > Form4.balance.Text Then

will return false.

Try to change the If or ElseIf using the Val function like you use in the UPDATE statement.

Also use the Val function to do the calculation of the new Form4.balance.Text

Anyway is diffcult to me to figure how Form6 has knowledge about Form1, Form4, Form7, Form8 and Form10.

Hope this helps

lolafuertes 145 Master Poster

On your TSDA data adapter you have only defined the SELECT command.
You need to define also the commands for INSERT, UPDATE and DELETE before calling TSDA.Update

Hope this helps

lolafuertes 145 Master Poster

If this software is OK for you, you can buy a license. This is a per application size license soft. And is not cheap. https://www.artinsoft.com/checkout/vbucee-versions.aspx

Anyway, from my experience, you do not want to carry old design + patches over your new .Net application. My suggestion is to re-design it from scratch and take all the advanteges from .Net

Hope this helps

lolafuertes 145 Master Poster

Better use Decimal.

lolafuertes 145 Master Poster

Two issues:
1) if GrandTotal is a float in the DB, do not surround the number with quotes in the SQL sentence
2) Searching on a float is generally not a good idea, because the internal precission representation of exponent and mantissa.

Please, can you be so kind to indicate what is the contents of strSQL before executing the SQL command?

Thanks in advance

lolafuertes 145 Master Poster

I Undertand.

Instead of looping on IsBusy you can:

dim myString as String
Function GetSite(ByVal as URL as String)
StartDownload(URL)
WebBrowser1.DocumentText = mystring
Retrun Nothing
End Function
Dim DataReceived as Boolean
Function StartDownload(ByVal URL As String)
Dim _client As New Net.WebClient
        Dim URL As String
        AddHandler _client.DownloadStringCompleted, AddressOf DownloadStringCompleted
        If My.Computer.Network.IsAvailable Then
            DataReceived = False
            _client.DownloadStringAsync(New Uri(URL))
            Do While Not DataReceived
                System.Windows.Forms.Application.Doevents()
            Loop            '
    End If

Return Nothing
End Function

Function DownloadStringCompleted(ByVal sender As Object, _
ByVal e As system.Net.DownloadStringCompletedEventArgs)
    DataReceived = True               
    If e.Cancelled = False AndAlso e.Error Is Nothing Then
         myString = CStr(e.Result)
    End If
Return myString
End Function

Hope this helps

lolafuertes 145 Master Poster

There is no easy way. Mostly just a few very small applications can be directly converted.

As an starting point you can read this even is written on 2005

Hope this helps

lolafuertes 145 Master Poster

DoEvents() just softly 'halts' executing the current thread and gives the oportuniti to other threads or applications to acces to CPU time, then returns to the next sentence. So it will loop until IsBusy is false. At this moment, also the DownloadStringCompleted will be fired.

I'm not sure why it returns an empty string as it 'should' return the answer. Should I assume that if you get it sync then you have a non empty response (even the GUI is frozen)?
Did you tried to set the event handler before the call to the DownloadStringAsync?
Is the DownloadStringCompleted event fired at any time?

Thans in advance for the info

lolafuertes 145 Master Poster

You have the .SelectedRows collection thar returns each selected DataGridiewRow
This has the index property that shows the current row number in the DatagridView starting from 0.

Hope this helps

lolafuertes 145 Master Poster

Can you put you current code here?

lolafuertes 145 Master Poster

After

AddHandler _client.DownloadStringCompleted, AddressOf DownloadStringCompleted

you should 'wait while is busy'

Do While _client.IsBusy
    System.Windows.Forms.Application.Doevents()
Loop
'
' And wait for the event to be fired
'
System.Windows.Forms.Application.Doevents()

Hope this helps

lolafuertes 145 Master Poster

This should work OK.

Can you put the entire piece of code and signal what and where you are testing to obtain the wrong result?

Thanks in advance

lolafuertes 145 Master Poster

Can you try to use the resulting Dataview instead of the table, because the table is never sorted while the view is:

Dim Dv as Data.DataView
Dv = SortData(dtDTBM)

If resultCheckEndOfYear = True Then
    BalanceEndOfYear(Dv)
Else
    Call BalanceData(Dv)
End If

And change the Sort function as

Private Function SortData(ByVal dtDTBM As DataTable) As DataView
    dtDTBM.DefaultView.Sort = String.Format("{0} {1}", "qFundCode", "ASC")
    Return dtDTBM.DefaultView
End Function

Also you should change the definitions of

Private Sub BalanceEndOfYear(ByRef dtDTBM As DataView)
Private Sub BalanceData(ByRef dtDTBM As DataView)

Specially be carefull when passing parameters. A table or a view 'must' be passed ByRef instead of ByVal in order to work properly.

Hope this helps

lolafuertes 145 Master Poster

Show() enables both forms so is normal that you still have the mouse jumping on your parent form.

Showdialog() enables the child form while disabling the parent. Give it a try.

Hope this helps

lolafuertes 145 Master Poster

What is your current code?

lolafuertes 145 Master Poster

May be you can try

Private Sub btnDS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDS.Click
        lNumbers.Sort()
        Dim MessageToShow as String
        For I as Integer = 0 to lNumbers.Count
            MessageToShow &= "Score " & (I + 1).Tostring & ": " & lNumbers.Item(I).Tostring & ControlChars.CrLf
        Next
        MessageToShow &= ControlChars.CrLf & "Total: " & totalScore.ToString & ControlChars.CrLf
        MessageToShow &= "Average: " & averageScore.ToString
        MessageBox.Show(MessageToshow)
    End Sub

Hope this helps

lolafuertes 145 Master Poster

Yes, but you split it 'after' the compare.

Just for test purposes you can add the code in red to verify 'where' are the differences.

Function GetValue(ByVal ValueToGet As String, Optional ByVal ValueAsInteger As Boolean = False)

        ValueToGet = ValueToGet.ToLower

        'UIText is defined earlier in the program and is the string of each line in the file being read.
        'LineText(X) is each line split into its parts at the = sign

        Try
            For x = 0 To 3000
                LineText = UIText(x).Split("=")
                Dim DefinitionText as String = LineText(0).ToLower.Trim.Replace("""","")
                'In the following line, even if the two values are equal, it goes directly to EndIf
                If ValueToGet.Length = DefinitionText.Length Then
                    Dim AreEquals As Boolean = True
                    For I as Integer = 0 to ValueToGet.Length
                        If ValueToGet.Chars(I) <> DefinitionText.Chars(I) then
                            AreEquals = False
                            MsgBox "The strings are not equal at " & I.ToString
                        End If
                    Next
                Else
                    MsgBox "The strings have distinc length"
                End If
                If ValueToGet = DefinitionText Then 'NOT WORKING!!!! ARG!!!
                    If ValueAsInteger = True Then
                        Dim ValueToReturn As String
                        ValueToReturn = LineText(1).Replace(" ", "")
                        Return Val(ValueToReturn)
                    Else
                        Dim ValueToReturn(2) As String
                        ValueToReturn = LineText(1).Split(Chr(34))
                        Return ValueToReturn(1)
                    End If
                End If
            Next
        Catch
            Return "Value Not Found"
        End Try

    End Function
lolafuertes 145 Master Poster

The UI.
The Lessons.
The Questions.
The Answers.
The Answer Explanations.
The GoNext.
The GoPrevious.
The GoToCurrentLesson.
The SaveCurrent.
The SaveScore.
The LoadCurrent.
The LoadLesson.
The LoadAnswer.
The LoadAnswerExplanation.

And other you can add.

Hope this helps.

lolafuertes 145 Master Poster

First question:
Try means exactly that. Try the code following the Try sentence. If any error occurs then skip the conde until the catch sentence and execute this code.
You may find also a Finally clause that is always executed.
The End Try sentence closes all the try execution block.

See http://msdn.microsoft.com/en-en/library/fk6t46tz(VS.80).aspx

This is useful when some unexpected error can happens IE: The underlying database is not acessible anymore because a change of permissions or a disk error, both situations out of the control of the program.

Second question:
Opening/closing the connection each time is more secure than doing once, but is slower. You must decide between both options.

If the program should run in a multiuser environment, and several users can access the database at same time, then you must choose security. If the application is to be run for a single user alone, an you can assure that no other user or process will access the database, then you can chooese the speedy way.

lolafuertes 145 Master Poster

The best way is to create user contros that ineherits from the control base.

On the user controls you can add as many properties, functions and methods you need.

In this example you should create two user controls: one for text base and the other for the panel.

When defining the user control youput inside the original control to be expanded.
Then on the UserControl class, you can add properties and methods to manage the original control.

Hope this helps

lolafuertes 145 Master Poster

You need to define wich menus/forms/functionalities should be permitted to each access level.
Also you need todefine a config file or DB table where to relate each username to the corresponding access level.

You need to create a function to retrieve the actual access level of the identified user.

On each form you need to show or hide the menus (if any) according to the user acces level. Also you may have to hide or disable some controls in the form.

IE: a reader user can see the info but can not modify it: The Save button should be hidden for this user.

Hope this helps

lolafuertes 145 Master Poster

I think you miss to store the scores. To do that, you can use a Specialized Collection of OrderedDictionary strings.
The collection's method add permits you to store the scores in the collection.
The collection's method clear permits you to clear all the contents of the collection.

The help on this kind of collection has examples on how to add, clear, remove and retrieve the collection items.

Hope this helpd

lolafuertes 145 Master Poster

Did you declared the child form as MDI child and set the MDI parent to the MDI one?
Do you open the child with show() or with ShowDialog()?

Thanks

lolafuertes 145 Master Poster

The FROM Clause is merging each BaseStation with all the possible Response_Team_On_shift records, then the result if filtered according to the WHERE clause.
Hope this is the behaviour expected.

To eliminate the duplicates you can modify the SELECT clause adding the DISTINCT restriction like:
sqlCmd.CommandText = "SELECT DISTINCT BaseStationCode, BaseStationName, ServiceArea, ResponseTeamOnShiftID, ShiftGrade, State FROM BaseStation, Response_Team_On_Shift WHERE ShiftGrade = '1' OR ShiftGrade = '2' OR ShiftGrade = '3'"

Hope this helps

lolafuertes 145 Master Poster

In red my suggestions:

Imports System.Data.SqlClient

Public Class frmPasscode
    Dim userPwd As String
    Dim userTxt As String
    Dim iLength As Integer
    Dim blnPwdFromKeyboard As Boolean
    Dim blnEnterPressed as Boolean = False

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

        Me.Visible = False
        SetLabelFont(Me)

        userPwd = ""
        lblPwd.Text = ""
        lblOK.Text = GetButtonText("POS.OK")
        lblCancel.Text = GetButtonText("POS.Cancel")
        lblMessage.Text = GetButtonText("POS.PasscodePrompt")


        Me.Visible = True
    End Sub

    Private Sub frmPasscode_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
     
        If xmlLocalPrinter Then
            Dim obj1 As New PrintDoc1
            Dim i As Integer = 0
            prtStrArr(i) = "" : i += 1
            prtStrArr(0) = "Bill Payment" : i += 1
            prtStrArr(1) = "CB" & Format(ViewCreditBalance(), "#,###,###.00") : i += 1
                     prtStrArr(2) = "Amount To Pay : " & SESSION_CURRENCY & " " & Format(frmMakePayment.TotalPayable, "#,###,###.00") : i += 1
         
            obj1.printMyDoc(3)
        End If
    End Sub

    Private Sub DisplayKey(ByVal sender As Object)
        If Not CheckPasswordControl() Then
            userTxt = Mid(sender.name, 4)

            iLength = Len(userPwd)
            If userTxt = "BackSpace" Then
                If iLength > 0 Then
                    userPwd = Mid(userPwd, 1, iLength - 1)
                    lblPwd.Text = Mid(lblPwd.Text, 1, iLength - 1)
                End If
            Else
                If iLength < 20 Then
                    userPwd &= userTxt
                    lblPwd.Text &= "*"
                End If
            End If
        End If
    End Sub


    Private Function CheckPasswordControl() As Boolean
        CheckPasswordControl = False
        If Not blnPwdFromKeyboard Then
            frmPopup.lblErrMsg.Text = GetButtonText("POS.MakePaymentAtCounter")
            frmPopup.YesNo = False
            frmPopup.QorEx = False
            frmPopup.ShowDialog()
            CheckPasswordControl = True
        End If
    End Function

    Private Sub frmPasscode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
        blnPwdFromKeyboard = True …
lolafuertes 145 Master Poster

Just to clearly undertand:

When you call GetValue, the string passed contains or not the quotes? You show one.

The line 10 contained "button1.text = "Hello My Name Is Matt"

This means that the string starts with quote?

If you compare ["button1.text] againts [button1.text"] this will fail because the quotes.

Did you try to loop over the char to verify si some thing is wrong?

lolafuertes 145 Master Poster

For the example I'll assume that Form2 is created using
Dim Form2 as New frmMyForm
being frmMyForm the class for the form being used


Then I will suggest to change the definition of sub Main as:

Sub Main(ByRef FormToUpdate as frmMyFomr)

Then inside the sub Main you can

FormToUpdate.Label2.Text = "I've prcessed a bit"
FormToUpdate.Label2.Refresh

Hope this helps

lolafuertes 145 Master Poster

At module level define:

Public EnterKeyPressed as Boolead = False

Then on the frmPasscode_KeyPress sub, after

ElseIf e.KeyChar = Chr(13) Then

add

If Not EnterKeyPressed Then
    picYes_MouseUp(Nothing, Nothing)
    EnterKeyPressed = True
End If

Hope this helps

lolafuertes 145 Master Poster

I prefer to write:

myCommand = New OleDbCommand("insert into payment  (slip) VALUES (" & wa.tostring & ") ", con)        'insert the value of "wa"

Hope this helps

lolafuertes 145 Master Poster

Please, can you be so kind to clarify:

1) Where do you define LineText as String()
2) The contents of UIText(10) you use to split
3) Why to you compare 3000 times if the UIText(10) has the ValueToGet

Thanks in advance

lolafuertes 145 Master Poster

Try to add a DataGridView1.Refresh() after setting the datasource. Aassuming that the table "AddressBook" has some rows, this will ensure that the contents of the data grid view is fully reloaded an repainted.

Hope this helps

lolafuertes 145 Master Poster

The + sign is actually representing the sum.

Cheese can be converted to a number while "youranswer is" can not.

Because InputBox returns always an string (that maybe empty) I would try some thing like

Dim Pizza As String
Dim Taco As String
Dim Cheese As String
Dim Cat As String = "You entered bad values"
Pizza = InputBox("Please Enter the first number")
Taco = InputBox("Please Enter the second number")
If Taco.Lenght>0 AndAlso Cheese.Length>0 then
    Dim iTaco as integer
    Try
        iTaco = Ctype(Taco, Integer)
    Catch ex As Exception
        Goto BadValue
    End Try
    Dim iPizza as integer
    Try
        iPizza = Ctype(Pizza, Integer)
    Catch ex As Exception
        Goto BadValue
    End Try

    Cheese = (iPizza + iTaco).ToString
    Cat = "youranswer is " & Cheese
End If
BadValue:
Print(Cat)

Hope this helps

lolafuertes 145 Master Poster

Pre-requisites:
Have the MySql Conector installed and referenced in your project.
Have a MySql database (MyBase) with a table (MyTable) having an Id integer field to reference the record and a FullPath string to hold the full absolute path to the image file.

Assumptions:
You already know the image Id to insert/search for (IE: 3) and the path is in the FullPath field

Actions:
To Retreive the Path from the DB:
Open a new connection to the MySql Database
Create a new Command to: SELECT FullPath FROM Mytable WHERE Id = 3
Create a Reader using the Command.ExecuteReader agains the connection
If the Reader has rows andalso Reader.Read is true then ResultingFullPath (as string) should be obtained from Reader.GetString(0)
Remenber to close the reader and the connection.

To Save the path to the database:
Open a new connection to the MySql Database
Create a new Command to :INSERT INTO Mytable VALUES ( 3, '\\Server\Share\Folder\File.jpg')
Execute the non query command against the connection. Should return 1 as the nuber of affected records.
Remenber to close the connection.

Remember to use try / catch blocks in the execution of the commands to intercetp and got knowledge of any error from the database.

Hope this helps

lolafuertes 145 Master Poster

The data type mismatch error means that some of the fileds in the where clause have distinct definition than the actually comparing value.

Try a slect with the same WHERE, and test, one by one, each field filter. You will find the offending one.

lolafuertes 145 Master Poster

Can you post a few rows of importer table?

TIA

lolafuertes 145 Master Poster
lolafuertes 145 Master Poster

Normally quantity, price and cost are numeric, so you do not need to surround the values wit single cuootes.

IE: dsql = dsql & "Price = " & PriceText.Text & " AND Cost = " & CostText.Text & " AND "

Hope this helps

lolafuertes 145 Master Poster

Please try the following:

Dim cmdimp As New OleDb.OleDbCommand("select cod_importer, Name_Importer from importer where cod_importer = " & codimporter & ";", conn)Dim drimp As OleDb.OleDbDataReaderconn.Open() drimp = cmdimp.ExecuteReader                    While (drimp.Read)                        ss.ComboBox4.Items.Add(drimp("Cod_importer") & " - " & drimp("Name_importer"))                    End While                    drimp.Close()Dim cmdimp As New OleDb.OleDbCommand("select * from importer where cod_importer = " & codimporter & ";", conn)
Dim drimp As OleDb.OleDbDataReader
conn.Open()

drimp = cmdimp.ExecuteReader
                    While (drimp.Read)
                        ss.ComboBox4.Items.Add(drimp.GetInt32(0).ToString & " - " & drimp.GetString(1))
                    End While
                    drimp.Close()

A few hints:
1) When executing a query agains a DB, request only the fields you need
2) The drimp("") refers to a column. You need to convert the object to a column, then get the value depending on the type of the column. Using the Getxxxx functions of the reader you can achieve the same results easely.
3) To get ride of the nulls in the DB, you can use the IsDbNull function to determine it.

Hope this helps