Begginnerdev 256 Junior Poster

Im sorry, I would like to edit my previous post.

You set the command type as well:

For example:

'Insert
data_adapter.InsertCommand = New OleDbCommandBuilder(data_adapter).GetInsertCommand

'Update
data_adapter.UpdateCommand = New OleDbCommandBuilder(data_adapter).GetUpdateCommand

'Delete
data_adapter.DeleteCommand = New OleDbCommandBuilder(data_adapter).GetDeleteCommand
Begginnerdev 256 Junior Poster

Have you tried dynamicly creating the update statement?

For example:

   Try         
        'Insert
        data_adapter.UpdateCommand = New OleDbCommandBuilder(data_adapter).GetInsertCommand

        'Update
        data_adapter.UpdateCommand = New OleDbCommandBuilder(data_adapter).GetUpdateCommand

        'Delete
        data_adapter.UpdateCommand = New OleDbCommandBuilder(data_adapter).GetDeleteCommand

        data_adapter.Update(CType(binding_source.DataSource, DataTable))   
   Catch ex As OleDbException
       MsgBox("ERROR:" & ex.Source & " " & ex.Message, MsgBoxStyle.OkOnly)
       MsgBox(cmd_builder.GetInsertCommand().CommandText, MsgBoxStyle.OkOnly)
   End Try
Begginnerdev 256 Junior Poster

You need to step through and see if the browser is not loading the document.

This code:

   While bLoad.ReadyState <> WebBrowserReadyState.Complete
       'Loop till loaded
   End While

Could be changed to this:

 While bLoad.ReadyState < 3
            'Loop till loaded.
 End While

This will loop until the browser has the ability to "see" the page contents.

Begginnerdev 256 Junior Poster

There a few different methods you can use to do this:

Print Form

Or

Print Document

Just retreive the active child and print!

Begginnerdev 256 Junior Poster

If you look closely in the code, the function GetAllLinks takes a parameter called sDocument.

The function is just a data retreival method, you should call Populate for your combobox.

For example:

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Populate("www.google.com")
    End Sub
End Class
Begginnerdev 256 Junior Poster

You can try something like this:

Private CurrentCollection As HtmlElementCollection

Private Sub Populate(ByVal sAddress as String)
    'For example: sAddress = "www.google.com"
    Dim linkCollection As HtmlElementCollection = GetAllLinks(sAddress)

    For i = 0 To linkCollection.Count - 1
        ComboBox1.Items.Add(i)
    Next

    'Keep track of current links
    CurrentCollection = linkCollection
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ComboBox1.SelectedIndexChanged
    Try
        If ComboBox1.SelectedValue < CurrentCollection.Count - 1 Then
            'Fill the Text Box
            TextBox1.Text = CurrentCollection.Item(CInt(ComboBox1.SelectedValue)).OuterText
        End If
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub


Private Function GetAllLinks(ByVal sDocument As String) As HtmlElementCollection
    Try
        Dim bLoad As New WebBrowser()
        bLoad.Navigate(sDocument)

        While bLoad.ReadyState <> WebBrowserReadyState.Complete
            'Loop till loaded.
        End While

        Dim htmlDoc As HtmlDocument = bLoad.Document

        'Return the Collection
        Return htmlDoc.Links
    Catch ex As Exception
        MsgBox(ex.ToString)
        Return Nothing
    End Try
End Function
Begginnerdev 256 Junior Poster

You can try something like this:

'I think this is what you meant by cColor.
Private _CurrentColor As Color = Color.White

Public Property cColor As Color
    Get
        Return Me._CurrentColor
    End Get
    Set(value As Color)
        Me._CurrentColor = value
    End Set
End Property

As for the dialog code:

Try
    'Create a new instance of the ColorDialog class.
    Dim cd As New ColorDialog

    'Set the dialog's properties.
    With cd
        'Dialog will have the custom color pane open automaticly.
        .FullOpen = True

        'Help button will NOT appear on the dialog.
        .ShowHelp = False

        'Ability to select any color.
        .AnyColor = True
    End With

    'If the user presses 'OK' set the Current Color and Background color of the current object.
    If cd.ShowDialog = Windows.Forms.DialogResult.OK Then
        cColor = cd.Color
        BackColor = cd.Color
    Else
        cColor = Color.Black
    End If
Catch ex As Exception
    MsgBox(ex.ToString)
End Try
Begginnerdev 256 Junior Poster

No problem, friend. Please don't forget to close the thread.

Begginnerdev 256 Junior Poster

I'm sorry, but we can't answer quizes/tests for you.

We are a help forum, not a DO forum.

Begginnerdev 256 Junior Poster

Have you come to a solution to this problem my friend?

Begginnerdev 256 Junior Poster

Do you have code that connects to the database for every report dataset?

If so, I would check that code first.

It could be something that is occuring before crystal even gets the data.

Begginnerdev 256 Junior Poster

What errors are you receiving?

Try placing the code in a try/catch:

Try
    'Your code here.
Catch ex As Exception
    MsgBox(ex.ToString)
End Try

If the following code:

Me.txtTypeOfEvaluation.Text = ds.Tables("Employees").Rows(0).Item(14)

Had thrown errors, I suspect an index out of range, or some kind of exception.

I would try:

txtTypeOfEvaluation.Text = IIF(IsDBNull(ds.Tables("Employees").Rows(0)("Classification")),String.Empty,ds.Tables("Employees").Rows(0)("Classification"))
Begginnerdev 256 Junior Poster

If you have an extensive knowledge of assembly, you can attempt to decompile it. (This is illegal unless you have a license to do so!!! I do not suggest this!)

If this is not the case, you will have to contact the software vendor/manufacturer and ask if there is a way, or what ports you may need to sniff.

Begginnerdev 256 Junior Poster

P.D The code doesn't need to be pretty, stable or optimized, but if it works, it's great.

Whoa now! If the code isn't stable - it never worked to begin with! =)

LuisAZC commented: LOL, you're right, my mistake. +0
Begginnerdev 256 Junior Poster

Without some sort of documentation or opening the ports on the firewall, you will have no starting point for your sniffer application.

Do you know any of these ports?

Begginnerdev 256 Junior Poster

Have you designed your database yet?

If not, you will have to think out what you want to store.

For example:

tblCountry
ID        |   Country
AutoNumber|VarChar(100)

'Data will look like:
'0,India
'1,China
'2,Russian Federation
'ect...

Store the exchange rates along with the dates:

tblRates
ID         |     CountryID    |     Rate     | Date
AutoNumber | FK to tblCountry | Number(10,2) | DateTime

'Data will look like:
'0,0,12.02,21-05-10 'May 21, 2010
'1,0,14.21,21-05-11 'May 21, 2011
'1,0,16.21,21-05-13 'May 21, 2013
'etc...

Now, to retreive the rates, you will need a reliable source.

Are you wanting to retreive from a certain source?

Begginnerdev 256 Junior Poster

If I understand what you are asking, then you are wanting a to write a program that checks to see the current exchange rates and store them into a database?

Begginnerdev 256 Junior Poster

You are looking at server/client programming.

Here is a nice project for a reference point.

Begginnerdev 256 Junior Poster

It sounds like you may have a memory, or hard drive problem.

My suggestion would be to download and run a memory test (Memtest86) and run chkdsk to check the hard drive for any errors.

Begginnerdev 256 Junior Poster

No problem! I hope you get the answers you need!

Begginnerdev 256 Junior Poster

I will flag your post to be moved the the SQL forum where you may receive more help.

Begginnerdev 256 Junior Poster

It sounds like you need a server/client setup, or you could add a way for the user to configure the path to the database ( on the local network ) using a DNS name or IP. (Static IP will be necessary if you wish to do it only once)

For example:

1)Place a button for configuring the connection
2)Place a text box for the string
3)Save the new value to the project settings:

Private Sub btnConfigure_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnConfigure.Click
    'sServerString will be defined in the project Settings
    My.Settings.sServerString = txtConnectionString.Text
    My.Settings.Save()

    'Now when creating your connection string, do something like this:

    'Dim con As New OleDBConnection("Provider=SQLXMLOLEDB.4.0;Data Provider=SQLNCLI11;Data Source=" & My.Settings.sServerString & _
    ";Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
End Sub
Begginnerdev 256 Junior Poster

Is your code compiled for older versions of the .NET framework? ie.. 2.0,3.0,4.0, 4.0 Client Profile

Begginnerdev 256 Junior Poster

Try something like this:

Try

'Your code here

Catch ex As Exception
    MsgBox(ex.ToString)
End Try

This will show the error message, the inner exception, and the stack trace all in one dialog box.

Post the image of the resulting error here.

Begginnerdev 256 Junior Poster

I would check with the ATM manufacturer to find out what keycode is being sent by those keys. Then look for that keycode with a keyboard hook

Begginnerdev 256 Junior Poster

What type of field are you storing this image in?

Begginnerdev 256 Junior Poster

First off, it is bittersweet to be ahead of your class. Bitter due to having a higher chance to make errors on code that you can't fully understand, but sweet because you can use the time to improve your coding/understanding of the language and logic.

As for this:

   Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
       Return lines(lineNumber - 1)
   End Function

If the value of lineNumber is equal to zero or greater than the size of the list + 1 you will always get this error.

You can fix this with something like this:

  Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
       If lineNumber - 1 > lines.Count - 1 Then Return "lineNumber was to large for the list: " & (lineNumber - 1) & " > " & lines.Count
       Return lines(lineNumber - 1)
  End Function

If you are trying to retreive the last element in the list, try this:

Public Function ReadLine(ByVal lines As List(Of String)) As String
    If lines.Count <=0 Then 
        Return String.Empty
    Else
        Return lines(lines.Count - 1)
    End If
End Function 

This will return the last element of the list, being the last line read in from the text file.

Begginnerdev 256 Junior Poster

Are you trying to read/write from/to the same file?

Begginnerdev 256 Junior Poster

Do you have the file open in Excel while trying to run the process?

Something has control of the file at that time.

Begginnerdev 256 Junior Poster

The correct syntax would be:

'Read/Split all lines.
 While sr.Peek <> -1
     lstAllLines.Add(sr.ReadLine().Split(",").ToList)
 End While
Begginnerdev 256 Junior Poster

I use code very close to this to manipulate CSV files all of the time.

A CSV file is treated as a text file; it just has formatting that you would not see usually.

What error are you getting for your csv?

Be sure to close the StreamReader/Writer with you are finished with your operations.

sr.Close()
sr = Nothing
sw.Close()
sw = Nothing
Begginnerdev 256 Junior Poster

What does the error message state?

Begginnerdev 256 Junior Poster

Something like:

Dim myCon As New OleDBConnection("ConnectionStringHere")
Dim da As New OleDBDataAdapter(New OleDBCommand("SELECT * FROM " & Filter,myCon))
Dim ds As New DataSet

da.Fill(ds,"MyTable")

If Not IsNothing(ds.Tables("MyTable")) And ds.Tables("MyTable").Rows.Count > 0 Then
    For Each r As DataRow in ds.Tables("MyTable").Rows
        TextBox1.Text = r("MyField1")
        TextBox2.Text = r("MyField2")
        'ect....
    Next
End If
Begginnerdev 256 Junior Poster

What are you storing these values in, a database?

If so, just write a sub routine that retreives information based on your selected:

Public Class Form1
    Private Sub GO_Click(ByVal sender As Object, ByVal e As EventArgs) Handles GO.Click
        Form2.Filter = ComboBox1.Text
    End Sub
End Class

Code for second form:

Public Class Form2
    Private sFilter As String = String.Empty

    Public Property Filter As String
        Get
            return sFilter
        End Get
        Set(value As String)
            sFilter=value
            PopulateFields()
        End Set
    End Property

    Private Sub PopulateFields()
        Try
            'Place query code here.
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub

End Class
Begginnerdev 256 Junior Poster

What mail client are you using?

Outlook?
Mozilla?
Live?

Begginnerdev 256 Junior Poster

On which line of code is this error thrown.

You seem to have a lot of hard coded indexes, it could be numerous things.

I would start with the obvious, do you have 14 cells in your datagridview?

Does your dataset have rows?

Begginnerdev 256 Junior Poster

You can add an attachment to an email by doing the following:

Dim oMail As New Net.Mail.MailMessage
oMail.Attachments.Add(New Net.Mail.Attachment("Path to my file"))

As for saving a copy local, you could parse the email into a text file and save it.

Begginnerdev 256 Junior Poster

I personally used this article as a reference when I was struggling with AD.

I hope this helps you as much as it helped me.

Begginnerdev 256 Junior Poster

You will want to open the file, read/split all lines, then rehash them with your delimiter:

This code is written on the fly.

Try
    'Reader/Writer for file operations.
    Dim sr As New StreamReader("PathToMyFile")
    Dim sw As New StreamWriter("PathToFile")

    'Lists for storage
    Dim lstAllLines As New List(Of List(Of String))
    Dim lstFinal As New List(Of String)

    'Read/Split all lines.
    Do While sr.Peek <> -1
        lstAllLines.Add(sr.ReadLine().Split(",").ToList)
    End While

    'Cycle through and delimit
    For Each lst As List(Of String) in lstAllLines
      Dim str As String = String.Empty
      For i = 0 to lst.Count - 1
          'Check to make sure you are not on the last element.
          If lst(i) < lst.Count - 1 Then
              str &= lst(i) & "|"
          Else
              str &= lst(i)
          End If
      Next
      lstFinal.Add(str)
    Next

    'Write all lines
    For Each s As String in lstFinal
        sw.WriteLine(s)
    Next
Catch ex As Exception
    MsgBox(ex.ToString)
End Try
Begginnerdev 256 Junior Poster

Sorry for total blunder, but it conn is supposed to OleDBConnection.

As for the command argument, you can also set a value:

conn.Parameters("@Bridge").Value = "MyValue"
Begginnerdev 256 Junior Poster

Are you writing this software for your android, or to run on a PC?

If you are writing for an android, you will need to learn the language. (modified Java)

As for it not working, are you getting an error - or nothing happens?

Begginnerdev 256 Junior Poster

What error are you getting on the other computer?

If you are using a DNS name on a server that is not on the same network as the other computer - then you will have to use the ip of the server.

Begginnerdev 256 Junior Poster

How are you declaring imageList?

Is it:

Dim imageList as New List(Of Image)

How are you storing these images?

Begginnerdev 256 Junior Poster

I was having problems with this concept quite a long time ago, but found this article.

Begginnerdev 256 Junior Poster

You can make use of the the datagridview's rows added and removed handlers:

Private Sub Rows_Added(ByVal sender As Object, ByVal e As DataGridViewRowsAddedEventArgs) Handles DataGridView1.RowsAdded
    Try
        'Update your dataset here.
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

Private Sub Rows_Removed(ByVal sender As Object, ByVal e As DataGridViewRowsRemovedEventArgs) Handles DataGridView1.RowsRemoved
    Try
        'Update your dataset here.
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub
Begginnerdev 256 Junior Poster

Are you getting an error?

Or are you confusing connection with command?

A command would be:

Dim con As New SQLConnection("Data Source=MYSERVER;Initial Catalog=MYDATABASE;Integrated Security=True"
Dim com As New SqlCommand("SELECT * FROM table",con)   
Dim da As New SQLDataAdapter(com)
Dim ds As New DataSet

da.Fill(ds,"MyTable")
Begginnerdev 256 Junior Poster

Closing a dead thread.

Sorry to leave it open for so long.

Begginnerdev 256 Junior Poster

If you have an exchange server that allows you to bounce emails, just use the server ip and port to send a SMTP email.

For example:

Sending SMTP Mail in VB.NET

Begginnerdev 256 Junior Poster

What Adapter are you using?

SQLClient, OLEDB, ACE ?

If you are using SQLClient Then try something like this:

Try
    Dim con As New SQLConnection("Data Source=MYSERVEr;Initial Catalog=MYDATABASE;Integrated Security=True")
    con.Open
Catch ex As Exception
    MsgBox(ex.ToString)
End Try
Begginnerdev 256 Junior Poster

Call this response harsh, but we are a help forum, not a do forum.

You can find a good project as a starting point here.

Please feel free to ask any questions about any problems you may have after you have attempted this yourself.