Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps you could check to see if WinZip support command line arguments.
If that is the case, then you can probably perform a standard extraction to a folder you choose.
Then you can use Process.Start() to run that EXE file.

If that is NOT the case, then you can check out this Add-On for WinZip, which enables it to support command lines.
http://www.winzip.com/prodpagecl.htm

Oxiegen 88 Basically an Occasional Poster Featured Poster

All you need to do is to reformat the query into an UPDATE query.
Like so:

Dim cmd As New OleDbCommand("UPDATE tblPurchase_Order SET " _
"[Supplier_Id] = @Supplier_Id, [Address] = @Address, [Project_Id] = @Project_Id, " _
"[dtpDate] = @dtpDate, [Material_Id] = @Material_Id, [Material_Name] = @Material_Name, _
"[Unit] = @Unit, [Quantity] = @Quantity, [Unit_Price] = @Unit_Price, " _
"[Amount] = @Amount WHERE [Order_Id] = @Order_Id")

cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@Order_Id", lstItems.Items(i).SubItems(0).Text)
cmd.Parameters.AddWithValue("@Supplier_Id", lstItems.Items(i).SubItems(1).Text)
cmd.Parameters.AddWithValue("@Address", lstItems.Items(i).SubItems(2).Text)
cmd.Parameters.AddWithValue("@Project_Id", lstItems.Items(i).SubItems(3).Text)
cmd.Parameters.AddWithValue("@dtpDate", lstItems.Items(i).SubItems(4).Text)
cmd.Parameters.AddWithValue("@Material_Id", lstItems.Items(i).SubItems(5).Text)
cmd.Parameters.AddWithValue("@Material_Name", lstItems.Items(i).SubItems(6).Text)
cmd.Parameters.AddWithValue("@Unit", lstItems.Items(i).SubItems(7).Text)
cmd.Parameters.AddWithValue("@Quantity", lstItems.Items(i).SubItems(8).Text)
cmd.Parameters.AddWithValue("@Unit_Price", lstItems.Items(i).SubItems(9).Text)
cmd.Parameters.AddWithValue("@Amount", lstItems.Items(i).SubItems(10).Text)
Oxiegen 88 Basically an Occasional Poster Featured Poster

I have now tested this code, and it works flawlessly.
And as a side-note. That Select..Case statement you've got going.
No matter what agency you choose, data(1) to data(5) will contain the exact same thing.
The only reason to use such a statement, is if you change the order or if one of the data(1) to data(5) will contain something else.
This is clearly not the case.

Public Sub GetFileContents()
	Try
		Dim aStr() As String = New String() {}
		Dim FILE_NAME As String = "C:\Program Files\Autopay Terminal\BillPaymentRecords.txt"

		If System.IO.File.Exists(FILE_NAME) = True Then
			Dim objReader As New System.IO.StreamReader(FILE_NAME)
			Do While objReader.Peek() <> -1
				aStr = Split(objReader.ReadLine(), ";")
				SESSION_AGENCY_NAME = aStr(0)
				SESSION_AGENCY_ACCNO = aStr(1)
				SESSION_AGENCY_BILLNO = aStr(2)
				SESSION_AGENCY_BILLAMO = aStr(5)
				SESSION_AGENCY_BILLINT = aStr(4)

				If aStr(5).Trim <> "" Then
					dTotal += CDbl(aStr(5).Trim)
				End If
				If aStr(4).Trim <> "" Then
					ServiceC += CInt(aStr(4).Trim)
				End If

				nTotlistrec = ListView1.Items.Count
				If nTotlistrec < 10 Then
					addListView(aStr(0), aStr(1), aStr(2), aStr(3), aStr(4), aStr(5))
				End If
			Loop
		End If
	Catch ex As Exception
		WriteToLogFile("GetFileContents() -> " & ex.Message)
	End Try
End Sub
Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
	pnlDelete.BackgroundImage = My.Resources.BtnUp

	Try
		pnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
		ListView1.SelectedItems(0).Remove()

		If File.Exists("C:\Program Files\Autopay Terminal\BillPaymentRecords.txt") Then
			File.Delete("C:\Program Files\Autopay Terminal\BillPaymentRecords.txt")
		End If

		Dim writer As New StreamWriter(Application.StartupPath & "\BillPaymentRecords.txt", True)
		For Each item As ListViewItem In ListView1.Items
			Dim line As String = item.SubItems(0).Text & ";" _
			& item.SubItems(1).Text & ";" & item.SubItems(2).Text & ";" _
			& item.SubItems(3).Text & ";" & item.SubItems(4).Text & ";" …
Oxiegen 88 Basically an Occasional Poster Featured Poster

So you decided to do this instead?
No wonder it's doesn't work and that the textfile is empty.

If what I gave you works, then use it.
In the method GetFileContents you already have the code in place to calculate the total.

There is no need to actually store the totals, just let the program calculate it.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok, I'm just assuming based on original question that the listview only contains 5 columns.
So, let's try this:

Public Sub GetFileContents()
   Try
      Dim aStr() As String = New String() {}
      Dim FILE_NAME As String = "C:\Program Files\Autopay Terminal\BillPaymentRecords.txt"

      If System.IO.File.Exists(FILE_NAME) = True Then
         Dim objReader As New System.IO.StreamReader(FILE_NAME)
         Do While objReader.Peek() <> -1
            aStr = Split(objReader.ReadLine(), ";")
            SESSION_AGENCY_NAME = aStr(0)
            SESSION_AGENCY_ACCNO = aStr(1)
            SESSION_AGENCY_BILLNO = aStr(2)
            SESSION_AGENCY_BILLAMO = aStr(3) 'Change from 5 to 3
            SESSION_AGENCY_BILLINT = aStr(4)

            If aStr(3).Trim <> "" Then
               dTotal += CDbl(aStr(3).Trim) '.Replace("RM", "")
            End If
            If aStr(4).Trim <> "" Then
               ServiceC += CInt(aStr(4).Trim) 'Replace("RM", "")
            End If

            nTotlistrec = ListView1.Items.Count
            If nTotlistrec < 10 Then
               addListView(aStr(0), aStr(1), aStr(2), aStr(3), aStr(4))
            End If
         Loop
      End If
   Catch ex As Exception
      WriteToLogFile("GetFileContents() -> " & ex.Message)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Well.
I don't know how the code for GetFileContents() looks like, so it's impossible for my to determine why it doesn't work.
Perhaps you should take a look and determine when and how the variables dTotal and ServiceC are assigned.

Oxiegen 88 Basically an Occasional Poster Featured Poster

How about we shorten this code a bit...

Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
        PnlDelete.BackgroundImage = My.Resources.BtnUp

   Try
      PnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
      ListView1.SelectedItems(0).Remove()

      If File.Exists("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt") Then
         File.Delete("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt")
      End If

      Dim writer As New StreamWriter("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt", True)
      For Each item As ListViewItem In ListView1.Items
         Dim line As String = item.SubItems(0).Text & ";" _
         & item.SubItems(1).Text & ";" & item.SubItems(2).Text & ";" _
         & item.SubItems(3).Text & ";" & item.SubItems(4).Text
         writer.WriteLine(line)
      Next
      writer.Flush()
      writer.Close()

      GetFileContents()

      lblBillAmountValue.Text = Format(dTotal, "#,###,##0.00")
      lblServiceCharge.Text = Format(ServiceC, "#,###,##0.00")
   Catch ex As Exception
      MsgBox(ex.Message)
   End Try
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps if you check the number of items in the listview?

If ListView1.Items.Count = 0 Then
   paymentBtn.Enabled = False
Else
   paymentBtn.Enabled = True
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you need to run some code on the SQL Server, that needs to be dynamic. Why not use Stored Procedures.
As you probably know, they can take arguments and perform different tasks.
And thus, create a SP with some common code and perform some action based on what the arguments are.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried WebBrowser1.Url.AbsolutePath?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Well, since you are the author of this program then you are the only one who fully understand how the program works.
So, you are the only one who can create the help form.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here is one way of performing that action.

Private Sub lvList_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles lvList.DoubleClick
   If lvList.SelectedItems.Count > 0 Then
      Dim title As String = lvList.SelectedItems(0).SubItems(1).Text

      'Create a new form with a custom constructor taking the title as argument.
      'Then perform any database lookups in that form based on the title.
      Dim frm As New PopUpForm(title)
      frm.ShowDialog
      frm.Dispose()
   End If
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Assuming that your datagridview is databound, and it's datasource is Me.Blood_bank_ds.st_name.
Have you tried using a BindingSource object?

Public Class st_name
   Private source As New BindingSource
   
   Public Sub st_name_Load(....
      DataGridView1.DataSource = source
   End Sub


   Private Sub Button2_Click(.....
      Me.St_nameTableAdapter.Fill(Me.Blood_bank_ds.st_name)

      'This will update the bindingsource, and because it's already tied to the datagrid the information in will be updated.
      source = Me.Blood_bank_ds.st_name
   End Sub
End Class
Oxiegen 88 Basically an Occasional Poster Featured Poster

The simplest way, I guess, would be to use Server Explorer in Visual Studio.
There you will see, if any, the database server and it's name.
You will find it in the View menu.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yeah, I can see the problem.
Try this:

Private Sub buttonDelete(ByVal sender As Object, ByVal e As EventArgs) Handles buttonDelete.Click
   'Exit sub if no items are selected.
   If ListView1.SelectedItems.Count <= 0 Then Exit Sub
   Try
      'Remove the selected item from the listview
      ListView1.SelectedItems(0).Remove()

      'Delete the file, and recreate it based on remaining items in the listview
      Dim myFile As String = "C:\test.txt"
      Dim stream As New IO.FileStream(myFile, IO.FileMode.Create)
      Dim writer As New IO.StreamWriter(stream)

      writer.WriteLine("First name,lastname,address")

      For Each item As ListViewItem In ListView1.Items
         writer.WriteLine(item.SubItems(0).Text & "," & item.SubItems(1).Text & "," & item.SubItems(2).Text)
      Next
      writer.Flush()
      writer.Close()
      stream.Close()

      MessageBox.Show("Record has been permanently removed","Record Purge", MessageBoxButtons.OK, MessageBoxIcon.Information)
   Catch ex As Exception
      MessageBox.Show(ex.ToString(), "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you put that code in the same method that removes the selected item from the listview, then yes, it will be deleted from the file as well.

Oxiegen 88 Basically an Occasional Poster Featured Poster

The error message "login failed" suggests the a connection is created but that either
a) you not using windows authentication but the connection string is set for a proper login,
b) you're not using windows authentication and the username and/or password is wrong.
c) you are using windows authentication but the connection string is wrong (Connectionstrings) or

You should look into those scenarios.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Glad to be of help. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

There are several ways to connect to a database on another computer.
If the database is on a Microsoft SQL Server, then you have the System.Data.SqlClient namespace.
If the database is an Access database, then you have the System.Data.OleDb namespace.

So, assuming the the database is an MS SQL Server then this is one way to connect to it.

Imports System.Data.SqlClient

Private Sub UpdateDatabase()
   Dim con As New SqlConnection("Data Source=computer2; Initial Catalog=thedatabase; User ID=billybob; Password=hamburger;")
   Dim com As SqlCommand = Nothing

   Try
      con.Open()
      com = New SqlCommand("UPDATE table SET col2=@p2 WHERE col1=@p1", con)
      com.Parameters.AddWithValue("@p1", 365)
      com.Parameters.AddWithValue("@p2", "Hello World")
      com.ExecuteNonQuery()
      con.Close()
   Catch ex As Exception
      If con.State = ConnectionState.Open Then
         con.Close()
      End If
   End Try
End Sub

For an Access database, the equivalent would be this:

Imports System.Data.OleDb

Private Sub UpdateDatabase()
   'MS Access 97-2003
   Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\computer2\sharedfolder\mydatabase.mdb;User Id=admin;Password=;")
   'MS Access 2007
   Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\computer2\sharedfolder\myAccess2007file.accdb;Persist Security Info=False;")

   Dim com As OleDbCommand = Nothing

   Try
      con.Open()
      com = New OleDbCommand("UPDATE table SET col2=@p2 WHERE col1=@p1", con)
      com.Parameters.AddWithValue("@p1", 365)
      com.Parameters.AddWithValue("@p2", "Hello World")
      com.ExecuteNonQuery()
      con.Close()
   Catch ex As Exception
      If con.State = ConnectionState.Open Then
         con.Close()
      End If
   End Try
End Sub
kvprajapati commented: :) +10
Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm assuming that this text file is to be used as permanent record storage for when you are not running your program.
If that is the case, then I would strongly suggest that you reformat the text file into a CSV format (which also can be imported into Excel).

First name,lastname,adress
rae,alanah,new york
john,smith,los angeles

Here's my solution on how to do this:

Dim myFile As String = "C:\test.txt"
Dim stream As New IO.FileStream(myFile, IO.FileMode.Create)
Dim writer As New IO.StreamWriter(stream)

writer.WriteLine("First name,lastname,address")

For Each item As ListViewItem In ListView1.Items
   writer.WriteLine(item.SubItems(0).Text & "," & item.SubItems(1).Text & ","
 & item.SubItems(2).Text)
Next
writer.Flush()
writer.Close()
stream.Close()

This will effectivaly write to the file only the records you have in the listview. And if the file already exists, it will be overwritten.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes, you can use the startup forms Form_Load event.
If you call upon a second form to display as a dialog, then the execution of the Form_Load will "halt" until you close that second form.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
   Dim players As New Form2
   players.ShowDialog() '<- Execution will halt here until you close Form2
   players.Dispose()
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Assuming that you already have three columns in the listview.
Here's how you can do that.

Dim xdoc As XDocument = XDocument.Load("url")

Dim query = From rssFeed In xdoc.Descendants("item") _
Select Title = rssFeed.Element("title").Value, _
Description = rssFeed.Element("description").Value, _
Link = rssFeed.Element("link").Value

For Each item In query
   Dim item As New ListViewItem("TITLE: " & item.Title)
   item.SubItems.Add("DESCRIPTION: " + item.Description)
   item.SubItems.Add("LINK: " + item.Link)
   ListView1.Items.Add(item)
Next
Oxiegen 88 Basically an Occasional Poster Featured Poster

You need to iterate through all the rows in the listview, and compare the content of the cells in the first column with the content in the textbox.
Like so:

For Each item As ListViewItem In listview1.Items
   If item.SubItems(0).Text = textbox1.Text Then
      MessageBox.Show("That name is already in the list.", "Existing name", MessageBoxButtons.OK, MessageBoxIcon.Stop)
      Exit Sub
   End If
Next
Oxiegen 88 Basically an Occasional Poster Featured Poster

In order to determine the datatype, you first need to determine the content type.
If the content type is String, then you need to find out if it's strictly numeric.
And if that is the case, then the content can be cast as Integer/Double/Decimal, or else you have to do something else with the information.

When that is done, you can perform your comparison.

Dim cellData As String = e.Row.Cells(4).Text
For Each c As Char In cellData
   If Not Char.IsNumeric(c) Then
      'The cell contains text, so do something about it

      'Jump out of the method, because you can't compare text ("abc") with numbers (123)
      Exit Sub
   End If
Next

'Then continue with your coding
Dim CellValue As Decimal = Convert.ToDecimal(cellData)
If CellValue < CDec(a) Then
   e.Rows.Cells(4).BackColor = Drawing.Color.Red
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

Assuming that the "table" is a DataTable object, then adding columns is very easily done.

'Assuming that the customer table is a DataTable object called dTable.
'First add the four new columns with a datatype of String
dTable.Columns.Add("data1", GetType(String))
dTable.Columns.Add("data2", GetType(String))
dTable.Columns.Add("data3", GetType(String))
dTable.Columns.Add("data4", GetType(String))

'Next, iterate through all the rows and add the information from the listbox to
'the four columns respectively.
For Each row As DataRow In dTable.Rows
   row("data1") = listbox1.Item(0)
   row("data2") = listbox1.Item(1)
   row("data3") = listbox1.Item(2)
   row("data4") = listbox1.Item(3)
Next
Oxiegen 88 Basically an Occasional Poster Featured Poster
Private Sub listview1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles listview1.Click
   If listview1.SelectedItems.Count > 0 Then
      'If listview2 is databound
      listview2.DataSource = Nothing
      'Else
      listview1.Items.Clear()

      PopulateDetailsView(listview1.SelectedItems(0).SubItems(0).Text)
   End If
End Sub

Private Sub PopulateDetailsView(ByVal condition As String)
   Dim SQL As String = "SELECT * FROM table WHERE item = '" & condition & "'"

   'bunch of code to make it happen
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Great minds think alike. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

I don't know how they can be magically converted to binary on their own.
If you create and save a file in Random mode, then they should be read in Random mode. Also, if you create and save in Binary mode, then you should read them in Binary mode.

However, perhaps the error is occuring because of Records = LOF(FF) | Len(TOPFILE).
Consider the fact that the length of some objects has a zero-based index.
So, the line could be rewritten as: Records = (LOF(FF) | Len(TOPFILE)) - 1

Oxiegen 88 Basically an Occasional Poster Featured Poster

You're welcome. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

If you browse the filesystem on your Pocket PC, can you see the text file in the My Documents folder?
If not, then perhaps this could be useful in order to avoid errors:

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

        Dim oRead As System.IO.StreamReader
        Dim Entire As String

        If IO.File.Exists(GetFolderPath(5) & "\test.txt") Then
            oRead = IO.File.OpenText(GetFolderPath(5) & "\test.txt")
            Entire = oRead.ReadToEnd()
            Label1.Text = Entire
        End If
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

What the code does is this.
First it reads the entire file, line by line.
And while it reads, each line is compared to the semi-colon separated string of the record from the ListView.
And if the string does NOT match the record, it's inserted into the ArrayList.

Once finished, the file is deleted, and recreated using the strings in the ArrayList, except for the deleted record.

Which reminds me, do this replacement:

'Replace this line
Dim writer As New StreamWriter("", True)

'With this line
Dim writer As New StreamWriter("C:\Documents and Settings\Desktop\BillPaymentRecords.txt", True)
Oxiegen 88 Basically an Occasional Poster Featured Poster
combProductName2.SelecedIndex = combProductName2.FindExact(tbProductName.text)
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ah yes! I'm so very sorry. I missed that one.
On the 4 lines below "Dim stringToFind......", add an ampersand (&) in the beginning, separating the ampersand and "Listview1.SelectedItems(0)..." with a blank space.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yeah. Replace the line
Dim stringToFind As String = ListView1.SelectedItems(0).Text
with this:
Dim stringToFind As String = ListView1.SelectedItems(0).SubItems(0).Text & ";" _
ListView1.SelectedItems(0).SubItems(1).Text & ";" _
ListView1.SelectedItems(0).SubItems(2).Text & ";" _
ListView1.SelectedItems(0).SubItems(3).Text & ";" _
ListView1.SelectedItems(0).SubItems(4).Text

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here it is.
Almost an exact copy of my previous solution, with the alterations to match your project.

Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
   Try
      Dim stringToFind As String = ListView1.SelectedItems(0).Text

      PnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
      ListView1.SelectedItems(0).Remove()

      Dim line As String
      Dim input As StreamReader
      Dim strFile As New ArrayList
         
      input = File.OpenText("C:\Documents and Settings\Desktop\BillPaymentRecords.txt")

      While input.Peek <> -1
         line = input.ReadLine

         If Not line.Contains(stringToFind) Then
            strFile.Add(line)
         End If
      End While

      input.Close()

      If File.Exists("C:\Documents and Settings\Desktop\BillPaymentRecords.txt") Then
         File.Delete("C:\Documents and Settings\Desktop\BillPaymentRecords.txt")
      End If

      Dim writer As New StreamWriter("", True)
      For Each item As String In strFile
         writer.WriteLine(item)
      Next
      writer.Flush()
      writer.Close()

      GetFileContents()

      lblBillAmountValue.Text = Format(dTotal, "#,###,##0.00")
      lblServiceCharge.Text = Format(ServiceC, "#,###,##0.00")
   Catch ex As Exception
      MsgBox(ex.Message)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You can download icons from any free icon repository on the internet.

Then go the project properties and select the Application tab.
There you can see a dropdown box called Icon. Select <Browse...> from the list and select the icon image you just downloaded.
Save.

Aaaand, your done. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

I had some success using the Oracle Data Access Components.
Just install and add a reference to Oracle Data Provider for .NET 2.0 10.2.0.2.20.
Then, add the line Imports System.Data.OracleClient.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Very odd. On Pocket PCs, the Personal folder is the same as My Documents.
I found this code snippet on MSDN for accessing Special Folders in .NET Compact Framework.

Public Shared Function GetFolderPath(folder As SpecialFolder) As String
   'Buffer to fill with path
   Dim path As StringBuilder = New StringBuilder(255)

   'Pass stringbuilder and folder identifier to api function
   If Not Convert.ToBoolean(SHGetSpecialFolderPath(IntPtr.Zero, path, CInt(folder), 0)) Then
      Throw New Exception("Cannot get folder path")
   End If
   Return path.ToString()
End Function

<DllImport("coredll", EntryPoint:="SHGetSpecialFolderPath", SetLastError:=False)> _
Private Shared Function SHGetSpecialFolderPath(hwndOwner As IntPtr, lpszPath As StringBuilder, nFolder As Integer, fCreate As Integer) As Integer
End Function
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok.
Let's try replacing "My.Computer.FileSystem.SpecialDirectories.MyDocuments" with "System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)"

Oxiegen 88 Basically an Occasional Poster Featured Poster

For the first problem, locking the textbox.
Add this event:

Private Sub BegBalance_Leave(ByVal sender As Object, ByVal e As EventArgs) Handles BegBalance.Leave
   If BegBalance.Text = String.Empty OrElse BegBalance.Text = "0" Then Exit Sub
   BegBalance.ReadOnly = True
End Sub

And then, in your RstButton click event. Add the line BegBalance.ReadOnly = False In order to keep track of the new balance, you should move the declaration of the variable NewBalance outside any methods, making it a class variable.
So, when you calculate the new balance, just dump the result into that variable, and reuse that value when calculating the next new balance. And so on and so on.

Oxiegen 88 Basically an Occasional Poster Featured Poster

label1.BackColor = Color.Transparent

Oxiegen 88 Basically an Occasional Poster Featured Poster

I posted the answer to a similar problem i May.
Perhaps it could be of some help: deleting a line from text file using VB.Net and edit

Oxiegen 88 Basically an Occasional Poster Featured Poster

It sounds like an indexing problem.
Perhaps this article could be of some use: http://www.databasejournal.com/features/mssql/article.php/1443581/Index-Optimization-Tips.htm

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ah. Now I see.
Ok, try this:

If TopRecords > 0 Then
   Rec = 1
   Do While Not EOF(FF)  '<<--- Replace the For loop with this While loop
      'UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. 
      FileGet(FF, TopData, Rec) 
      '
      If TopData.Deleted = True Then
         TopData.ExcelRecord = 0
         TopData.DataSheet = ""
         TopData.TopName = ""
         TopData.TopDate = ""
         TopData.ExcelJobName = ""
         TopData.PipeRecap = ""
         TopData.Catagory = 0
         '
         For X = 0 To 19
            TopData.TopProperties(X) = 0
         Next X
         '
         TopData.Catagory = 0
         TopData.Status = 0
         '
         'UPGRADE_WARNING: Put was upgraded to FilePut and has a new behavior. 
         FilePut(FF, TopData, Rec)
      End If
      '
      Rec += 1
   Loop
End If
Simran Kaur commented: was very helpful & thoughtful +1
Oxiegen 88 Basically an Occasional Poster Featured Poster

iTextSharp does not support that.
The parsers that comes with iTextSharp can only create new PDF-documents.
However, if you have an existing PDF you can use those parsers and create a second one and then concatinate the two PDFs into one.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If you mean that you would like to show the RTF data as a PDF, then there are ways to first convert the RTF into HTML. And from there you can use iTextSharp to convert the HTML into a PDF.

Writing your own RTF converter
Need help with creating PDF from HTML using itextsharp

Oxiegen 88 Basically an Occasional Poster Featured Poster

I don't even know what RS_UtilityService is, so I can't give any examples of how to convert.
But I thought of another solution that MIGHT work.

rpt.SetDataSource(grdreport.DataSource)

If this doesn't work, then I must tell you that I cannot help you any further.
Because, I'm quite a newbie regarding Crystal Reports myself.

Oxiegen 88 Basically an Occasional Poster Featured Poster

It could be because DT_Data is not exactly a .NET DataTable.
Which is why I used a DirectCast statement.
But obviosly it doesn't work, so you'll have to replace DT_Data with a normal DataTable.

I noticed in your code that you have declared tabl1 as a DataTable, but it's not being used.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Try to replace the part in red with this.
Although, I don't know if it works on Pocket PC devices.

oRead = IO.File.OpenText(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\test.txt")
Entire = oRead.ReadToEnd()

My.Computer.FileSystem.SpecialDirectories.MyDocuments is a VB.NET shortcut to the "C:\Documents and Settings\<current user>\My Documents" folder.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yeah. You have to create it first.
In the solution explorer, right-click, add new item. Crystal Report.