Oxiegen 88 Basically an Occasional Poster Featured Poster

Do you remember the connection string I gave you in your previous post "Need Help"?
Try using that one instead.

If I recall correctly, the constant DATA_SOURCE already contains "data source=JAKE-PC\SQLEXPRESS", so what you have done in your StingBuilder is declare the data source twice.
It's redundant, and causes errors.

And, the format of your connection string is targeted towards MSSQL 2005/2008.
Try using "Integrated Security=SSPI" instead of "trusted_connection=yes;".

Oxiegen 88 Basically an Occasional Poster Featured Poster

Well. Having tried my luck on relying purely on the Designer myself, I know that sometimes you can miss or forget certain details.
By doing the coding yourself, you can get a clearer view of what's going on.

Not to dismiss the Designer entirely, most of the time it saves the day.
But sometimes you need to get your hands dirty and do it yourself. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. How about this.
This always works for me.
I'm manually creating and adding each column in the forms Load event, instead of using the Designer.
That way I get more control on what goes where, and how.

Imports System
Imports System.Data.SqlClient

Public Class Form1
    Private connString As String = "Data Source=<computerName>\SQLEXPRESS; Initial Catalog=<database>;Integrated Security=SSPI;"
    Private bindingSource1 As New BindingSource
    Private myDA As SqlDataAdapter
    Private mydataset As DataSet

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

        DataGridViewSearchExist.AutoGenerateColumns = False

        Dim clmID As New DataGridViewTextBoxColumn
        clmID.HeaderText = "ID"
        clmID.DataPropertyName = "t_id"
        DataGridViewSearchExist.Columns.Add(clmID)

        Dim clmFirstName As New DataGridViewTextBoxColumn
        clmFirstName.HeaderText = "First Name"
        clmFirstName.DataPropertyName = "firstName"
        DataGridViewSearchExist.Columns.Add(clmFirstName)

        Dim clmLastName As New DataGridViewTextBoxColumn
        clmLastName.HeaderText = "Last Name"
        clmLastName.DataPropertyName = "lastName"
        DataGridViewSearchExist.Columns.Add(clmLastName)

        Dim clmRentPaid As New DataGridViewTextBoxColumn
        clmRentPaid.HeaderText = "Rent Paid"
        clmRentPaid.DataPropertyName = "rentPaid"
        DataGridViewSearchExist.Columns.Add(clmRentPaid)

        Dim clmDatePaid As New DataGridViewTextBoxColumn
        clmDatePaid.HeaderText = "Date Paid"
        clmDatePaid.DataPropertyName = "datePaid"
        DataGridViewSearchExist.Columns.Add(clmDatePaid)

        Dim clmPropRef As New DataGridViewTextBoxColumn
        clmPropRef.HeaderText = "Property Reference"
        clmPropRef.DataPropertyName = "propRef"
        DataGridViewSearchExist.Columns.Add(clmPropRef)

        Dim clmRentDue As New DataGridViewTextBoxColumn
        clmRentDue.HeaderText = "Rent Due"
        clmRentDue.DataPropertyName = "rentDue"
        DataGridViewSearchExist.Columns.Add(clmRentDue)

        DataGridViewSearchExist.DataSource = bindingSource1
    End Sub

    Private Sub RadTextBoxTenantIdSearchExist_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadTextBoxTenantIdSearchExist.TextChanged
        BindData()
    End Sub

    Private Sub BindData()
        Try
            myDA = New SqlDataAdapter("SELECT t_id, firstName, lastName, rentPaid, datePaid, propRef, rentDue FROM payments WHERE t_id = '" & RadTextBoxTenantIdSearchExist.Text & "'", connString)
            Dim builder As SqlCommandBuilder = New SqlCommandBuilder(myDA)
            myDA.Fill(mydataset, "payments")
            bindingSource1.DataSource = mydataset.Tables("payments")
        Catch ex As Exception
            bindingSource1.DataSource = Nothing
        End Try
    End Sub …
Oxiegen 88 Basically an Occasional Poster Featured Poster

First, move the line DataGridViewSearchExist.DataSource = bindingSource1 to the forms Load event.
You only need to assign that once.

And make sure that the fields "t_id, firstName, lastName, rentPaid, datePaid, propRef, rentDue" are still tied to each of the columns you have created in the DataGridView.
Each field name are to be typed into each columns DataPropertyName property.

I would render a guess as to that might be the main reason for why it stopped working.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If you wanna move or copy files from one location to another using your program, there are easier ways than using FileStream.

Imports System.IO

    Private Sub FileCopy()
        Dim strFileSource As String = "C:\Temp\sourceFile.txt"
        Dim strFileDestination As String = "C:\Temp\destinationFile.txt"

        File.Copy(strFileSource, strFileDestination)
    End Sub

    Private Sub FileMove()
        Dim strFileSource As String = "C:\Temp\sourceFile.txt"
        Dim strFileDestination As String = "C:\Temp\destinationFile.txt"

        File.Move(strFileSource, strFileDestination)
    End Sub

    Private Sub CopyMoveMultipleFiles()
        Dim strSourceDirectory As String = "C:\Temp"
        Dim strDestinationDirectory As String = "C:\SecondaryTemp"
        Dim di As New DirectoryInfo(strSourceDirectory)

        'To copy files
        For Each fi As FileInfo In di.GetFiles
            fi.CopyTo(strDestinationDirectory & "\" & fi.Name)
        Next

        'To move files
        For Each fi As FileInfo In di.GetFiles
            fi.MoveTo(strDestinationDirectory & "\" & fi.Name)
        Next
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm starting to see a pattern here.
Try this connection string, without using a StringBuilder.

_connectionString = "Data Source=JAKE-PC\SQLEXPRESS; Inital Catalog=Ticketing; Integrated Security=SSPI"

And the connection string cannot be passed as the name of a Stored Procedure.
It has to be the name of an existing Stored Procedure in the database server.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Sure, you can have your own column headers.
However (and I must refer to others on this one) I don't think that the ColumnAdded event is triggered AFTER the databind is done.

First, just add and name the columns in the Designer, as you tried to do.
But you MUST also enter the name of the database field in the DataPropertyName property for each column.
When that is done, go to the form load event and add this line as the very first line.

DataGridViewSearchExist.AutoGenerateColumns = False
Oxiegen 88 Basically an Occasional Poster Featured Poster

You should consider moving that code onto a button click event.
Otherwise the query will be fired for every keystroke you use in the textbox.

And you are very close to the solution, my friend. :)
Notice my lack of use of the SqlConnection object. It will work anyway, because the SqlDataAdapter will take care of connecting to the database. If provided with the connection string.

The SqlCommandBuilder will help take care of creating INSERT, UPDATE and DELETE statements for you.

Private bindingSource1 As New BindingSource

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
   AuthorsGridView.DataSource = bindingSource1
End Sub

Private Sub TextBoxId_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxIdSearchExist.TextChanged
   Try
      da = New SqlDataAdapter("SELECT * FROM pay WHERE t_id = '" & tId.Text & "'", <your connection string>)
      Dim builder As New SqlCommandBuilder(da)
      da.Fill(ds, "pay") 'Needs to be the name of the source table
   
      'I don't know what GetData(queryString) is for, so I'm ignoring it
      If ds.Tables.Count > 0 Then
         bindingSource1.DataSource = ds.Tables(0)
      Else
         MessageBox.Show("No results found in database.")
      End If
   Catch ex As Exception
      MessageBox.Show("Unable to connect to database, or an error occured.")
   End Try
End Sub
kingsonprisonic commented: Nice !! +1
Oxiegen 88 Basically an Occasional Poster Featured Poster
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you want instant storing of the forms position when you move it, you need to use the MouseDown, MouseMove and MouseUp events.

'First a private member variable
Private bIsMouseDown As Boolean = False

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        'First check to see which mousebutton was pressed
        If e.Button = Windows.Forms.MouseButtons.Left Then
            'Then check to see if the location of the mouse is within the region of the form
            If e.Location.X > Me.Bounds.Left AndAlso e.Location.X < Me.Bounds.Right _
            AndAlso e.Location.Y > Me.Bounds.Top AndAlso e.Location.Y < Me.Bounds.Bottom Then
                bMouseDown = True
            End If
        End If
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        If bMouseDown Then
            MyX = Me.Location.X
            MyY = Me.Location.Y
        End If
    End Sub

    Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
        bMouseDown = False
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You can put this method in a Module, and call it from the form containing the ListView.
I've commented on what's going on in the code.

''The listview is provided as a referenced argument
    Public Sub PopulateListViewFromAccess(ByRef lv As ListView)
        'Create a connection string to the MS Access database.
        'The first version is using the standard JET driver
        'The second version is using the upgraded ACE driver for Access 2007 and above
        Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Application.StartupPath & "\mydatabase.mdb; User Id=admin; password=;"
        'Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\mydatabase.accdb; Persist Security Info=False;"

        'Create a connection to the database
        Dim conn As New System.Data.OleDb.OleDbConnection(connectionString)
        Dim com As System.Data.OleDb.OleDbCommand
        Dim reader As System.Data.OleDb.OleDbDataReader

        Try
            'Open the connection
            conn.Open()
            'Create a new instance of the command and provide the SELECT query, and the opened connection
            com = New System.Data.OleDb.OleDbCommand("SELECT * FROM <table>", conn)
            reader = com.ExecuteReader(CommandBehavior.CloseConnection)

            'Check to see if the SELECT query returned any rows
            If reader.HasRows Then
                'If so, perform a read for each row
                While reader.Read
                    'Declare a new ListViewItem, and provide the information
                    'to be shown in the very first column
                    Dim item As New ListViewItem(reader.Item("<column1>").ToString)

                    'Decare a new ListViewSubItem, and provide the information
                    'to be shown in the second (and so forth) column
                    Dim subItem As New ListViewItem.ListViewSubItem()
                    subItem.Text = reader.Item("<column2>").ToString

                    'Add the ListViewSubItem to the ListViewItem
                    item.SubItems.Add(subItem)

                    'Add the ListViewItem to the ListView
                    lv.Items.Add(item)

                    'Repeat until all rows have been read
                End While
            End If …
Oxiegen 88 Basically an Occasional Poster Featured Poster

You need to grab the handle of the application for which you want to save the document.
In order to achieve this, you need to use Windows API to grab and perform.

''' A couple of APIs
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindow(ByVal lpcClassName As String, ByVal lpWindowName As String) As IntPtr
End Function

<DllImport("user32.dll", EntryPoint:="FindWindow", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowByClass( _
     ByVal lpClassName As String, _
     ByVal zero As IntPtr) As IntPtr
End Function

<DllImport("user32.dll", EntryPoint:="FindWindow", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowByCaption( _
     ByVal zero As IntPtr, _
     ByVal lpWindowName As String) As IntPtr
End Function

<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, _
                      ByVal childAfter As IntPtr, _
                      ByVal lclassName As String, _
                      ByVal windowTitle As String) As IntPtr
End Function

<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Public Function SendNotifyMessage( _
     ByVal hWnd As IntPtr, _
     ByVal msg As UInteger, _
     ByVal wParam As UIntPtr, _
     ByVal lParam As IntPtr _
     ) As Boolean
End Function 

''' General methods
Const BM_CLICK As Uinteger = &HF5
Dim WindowHandle As IntPtr
Dim ButtonHandle As IntPtr

'First grab the actual window of the application
WindowHandle = FindWindowByCaption(IntPtr.Zero, "Caption of Notepad window")
'Second, grab the desired function/button within the window/application, in this case the Save button
ButtonHandle = FindWindowEx(WindowHandle, 0, "Button", "&Save")

'Send a message to the grabbed window/button to perform an action, in this case click the Save button
SendNotifyMessage(ButtonHandle, BM_CLICK, 0, 0)
Oxiegen 88 Basically an Occasional Poster Featured Poster

Is her computer in the same environment as your own computer?
Perhaps her computer is behind a firewall (or Windows Firewall) that requires her ftp client to connect using Passive FTP.

Perhaps you should consider using a custom ftp client for your application.
Take a look at this FTP client.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You could use the method GetProcessesByName in order to determine if a certain process is running.
It returns an array of processes containing all instances of a certain named process, for example "wmplayer".
If the Length of the array is greater than 0, then that particular process is running.
This snippet also eliminates the need for ListBoxes and things like that.

If GetProcesses("wmplayer") > 0 Then
   textbox.Text = textbox.Text & Environment.NewLine & "     -> Windows Media Player"
End If

Private Function GetProcesses(nameOfProcess As String) As Integer
   Dim namedProcess As Process() = Process.GetProcessesByName(nameOfProcess)
   Return namedProcess.Length
End Function
Oxiegen 88 Basically an Occasional Poster Featured Poster

There is really no sure way to programmatically determine whether or not another program can be run.
The only way to really it is to actually try to execute the file.
On that front, you can use the Shell commands FileNotFound exception error in order to determine if the file can be executed or not.
Like so:

Try
   Shell("""abc.exe"")
Catch fx As System.IO.FileNotFoundException
   'Something went wrong with the execution of the file.
   'Either it's a 16-bit command trying to be run on a 32-bit system,
   'or the file cannot be found
Catch ex As System.Exception
   'Catch any other Exceptions here
End Try
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you install the Visual Basic PowerPack for Visual Studio you will get access to various shape controls, like the OvalShape.
You can use that to mark parts on your image, and indicate that it's clickable by changing the cursor whenever you hover on it.

Oxiegen 88 Basically an Occasional Poster Featured Poster

My first thought is that when you deploy the program, the CreateDirectory method may not have sufficient rights to create a folder on the hard drive, and thus skips the call to InitiateDownload.
Have you tried running it as Administrator?

My second thought is that you may wish to add a Try...Catch statement in both the FileDownload_Load event and in the InitiateDownload method.
That way you can track where things goes sideways, if that is the case.

Other than that, your code is spot on. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

Oh you should definitely use the New keyword, since it's a class.
And you forgot to add an argument between "Activity = Added" and DataViewRowState.CurrentRows.
You need a sorting argument, however if you don't need to sort just add an empty string: "".

Also, if "Added" is a value stored as string in the database, then you need to enclose it within single-quotes. Like so: "Activity = 'Added'".
That's the equivalent of the SQL Where clause.

One last thing.
On this line: da.Fill(ds, "Filter Dataview")
Do you really have a table called "Filter Dataview" in your database?
You should type in the actual name of the source table.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can filter it directly through SQL, using a WHERE clause.
But because you are using a Stored Procedure, the reasoning becomes that you might wish to reuse that particular SP for more than one task. Am I right?
That's why it's better to just grab it all and filter it later using a DataView.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can use a DataView to filter, sort and search through a DataTable.
Here is an example of how to filter using a DataView: http://vb.net-informations.com/dataview/filter-dataview.htm

Oxiegen 88 Basically an Occasional Poster Featured Poster

You were very close to the solution, my friend.

Dim dr As New DataGridViewRow
dr.CreateCells(gridname)
gridname.Rows.Add(dr)
Oxiegen 88 Basically an Occasional Poster Featured Poster

You can create a SQL file (a textfile) that you then can read and exexute at runtime and direct it towards an Access 2007 database file.

Here is an example of how to create it using ADOX (Microsoft ADO Ext): http://www.vbforums.com/archive/index.php/t-251384.html

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here is a suggestion:

Dim list As New List(Of DataRow) 'Your generic list of DataRow

Dim list1() As DataRow = New DataRow() {}
Dim list2() As DataRow = New DataRow() {}

'Begin by copying the first three elements in the list to a new array
list.CopyTo(0, list1, 0, 3)

'Then copy the remaining elements to a second new array
list.CopyTo(2, list2, 0, list.Count - 3)

'Syntax:
'<list>.CopyTo(<startIndex of source list>, <destinationArray>, <destinationIndex of destinationArray>, <number of elements to copy>)
Oxiegen 88 Basically an Occasional Poster Featured Poster

Why not just create a random integer between 1 and 9, throw it into a string and then add a "0." in front of it?
That would give you the 0.1, 0.2 and so on, as a String.
Once that is done, you can convert the string into a double.

Dim random As New Random()
Dim number As String = random.Next(1, 9).ToString()
number = "0." & number
Dim result As Double = Double.Parse(number)
Oxiegen 88 Basically an Occasional Poster Featured Poster

In addition to adding the reference to Microsoft Outlook 14, make sure that you also import the namespace Microsoft.Office.Interop.

Then you can use this code to create a mail message.

Dim oApp As New Outlook.Application()
Dim oMsg As Outlook.MailItem

oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
oMsg.To = "reciever@domain.com"
oMsg.Subject = "mail subject"
oMsg.Body = "simple mail body text"
'' OR
'oMsg.HTMLBody = "html mail body text"

oMsg.Send()

'Optionally also use:
'oMsg.Display()
debasisdas commented: agree +13
Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes, I would revise that code into something like this.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim playerdrivers As New ArrayList
   Dim destination As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\f1data\bin\array.txt"
   Dim FileReader1 As New StreamReader(destination)
   Dim Contents1 As String
   Dim index As Integer = 0

   While FileReader1.Peek <> -1
      Contents1 = FileReader1.ReadLine
      Dim array As New ArrayList
      array.AddRange(Contents1.Split(","))
      playerdrivers.Add(array)
   End While

   FileReader1.Close()

After that you can easily access each player and driver using almost the same method as you intended:
playerdrivers(0).Item(0) - playerdrivers(0).Item(5)
playerdrivers(1).Item(0) - playerdrivers(1).Item(5)

djjavo commented: Very helpful. +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes it is.
But you still need to explicitly tell the query which field to use.

cmd.CommandText = "INSERT INTO " & combobox.SelectedItem & " (<field>) VALUES ('" & textbox.Text & "')"
Oxiegen 88 Basically an Occasional Poster Featured Poster

Why not convert the method into a function that returns a string.
And then enclose the code in a Try...Catch statement.
If the code should fail, then you can return the .ToString() of the exception object and examine what went wrong.
Otherwise you just return an empty string.

swathys commented: tq +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

Try changing conn.GetSchema("TABLES") into this: conn.GetSchema("Tables", New String() {Nothing, Nothing, "TABLE"} And skip setting the ValueMember and DisplayMember properties.

Solution provided by this thread.

Oxiegen 88 Basically an Occasional Poster Featured Poster

It doesn't really matter which database source that you use (SQL Server (any edition), Access, Excel, Oracle and so on).
As long as you can get the relevant data into a DataTable, then all you have to do is use that as the DataSource for the crystal report.

Oxiegen 88 Basically an Occasional Poster Featured Poster

x = system.io.path.getfilename(track) will only give you the filename.

If you want to display only the filename, but still have access to the full path, then I suggest that you add a second, hidden, ListBox where you store the full path and filename.
And every time that you add another track to the playlist, then at the same time add the full path to the second ListBox using the "track" string.

So, when you click the song in the playlist, the song gets played from the second ListBox.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Even if the communication with Excel is threaded, the code should still be there.

And you may not find any references to Excel interop, because there are other ways to communicate with Excel files.
OleDb comes to mind, and also third-party components like GemBox Spreadsheet.
Have you considered that these factors may be in affect?

Oxiegen 88 Basically an Occasional Poster Featured Poster

I did a similar thing a while ago.
What I did was hardcode a bunch of macro-type strings into the client, for example: "#PLAY#", "#STOP#" or "#PAUSE#".
By sending the same string from the server and comparing the hardcoded string against the incoming string you can then call any other function to perform a specific task tied to that macro-string.

And also, if you need to send a file for the server to play, you need to send it as a byte array. Not a string.

Oxiegen 88 Basically an Occasional Poster Featured Poster
dgvBlock_Acc.Rows.Clear()

And/Or

dgvBlock_Acc.Columns.Clear()
Oxiegen 88 Basically an Occasional Poster Featured Poster

Glad to be of help. :)
Please mark this thread as solved if your question has been answered to you satisfaction.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Sure, in that case you can use the standard windows scheduler.
How To Schedule Tasks in Windows XP

Oxiegen 88 Basically an Occasional Poster Featured Poster

In the form load event, see if adding these three lines helps:

Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried clearing the DataGridView control each time you select that tab, before calling the PopulateAccess method?

Oxiegen 88 Basically an Occasional Poster Featured Poster

For it to be a .vb script, you cannot use another file extension.
You can however re-assign .vb files to use Notepad, and keep .vbproj and .sln files assigned to Visual Studio.

Oxiegen 88 Basically an Occasional Poster Featured Poster

There is no way to schedule a webservice.
But you can easily create a reference to a webservice, and it makes no difference how it was created.
In Visual Studio in the Solution Explorer, right click on the project and select Add Service Reference. Click on the button Advanced at the bottom and then click Add Web Reference.
In this window you simply type in the URL to the webservice and click Go, type in a Web reference name and click Add Reference.

If you have a VB.NET windows app, then you can reference practically any webservice created in either ASP.NET, PHP or whatever.
It's up to you to handle the returns from the service.

Oxiegen 88 Basically an Occasional Poster Featured Poster

In order to add names from the database to the combobox you can more or less use the same code as for the search. Observe the change in the SQL string.

Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\~LaiLi~\My Documents\Visual Studio 2005\Projects\MoreWever\MoreWever\bin\Debug\Inventory.mdb"
        sql = "SELECT * FROM Profile"
        con.Open()
        Dim cmd As OleDbCommand
        Dim dr As OleDbDataReader

        cmd = New OleDbCommand(sql, con)
        dr = cmd.ExecuteReader

        While dr.Read()
            If Not StudNameComboBox.Items.Contains(dr("StudName")) Then
               StudNameComboBox.Items.Add(dr("StudName"))
            End If
        End While

        dr.Close()
        con.Close()

The IF NOT statement makes sure that no duplicate names are added.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I think Access is a bit more picky and needs to be told explicitly what kind of JOIN you are performing.
I suggest that you use either INNER JOIN or OUTER JOIN instead of just JOIN.
For more detail I also suggest that you read up a bit about using JOINs in Access.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can change the original cmd.CommandText text so that you incorporate both the insert and the select query using the EXISTS condition.
Like so:

cmd.CommandText = "INSERT INTO tbl_curriculum (course_code,subj_code) VALUES ('" & txtCode.Text & "','" & txtScode.Text & "') WHERE NOT EXISTS (SELECT subj_code FROM tbl_curriculum WHERE subj_code = '" & txtScode.Text & "')"

This will both save you some coding and also get rid of that IF statement.

debasisdas commented: effective solution. +9
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. Try replacing Environment.NewLine with the HTML tag for linebreak: "<br />".

Oxiegen 88 Basically an Occasional Poster Featured Poster

Like so:

Imports System
Imports System.IO
Imports System.Net

Private Function FetchSource() As String
   'Address of URL
   Dim URL As String = "http://www.somesite.com/somepage.html"

   'Create a WebRequest object, used to send the request to the website
   Dim request As WebRequest = WebRequest.Create(URL)

   'Create a WebResponse object, used to contain the response from the website
   Dim response As WebResponse = request.GetResponse()

   'Create a StreamReader object, used to read the incoming data from the website
   Dim reader As StreamReader = New StreamReader(response.GetResponseStream())

   'Read the entire content from the StreamReader object into a string variable
   Dim str As String = reader.ReadToEnd()
   reader.Close()

   Return str
End Function

And once you have the source, ie the HTML code, you can use standard string functions to locate and extract the information.

Private Sub ParseSource()
   Dim src As String = FetchSource()
   Dim temp As String
   Dim index As Integer

   'Locate the initial tag in the source
   index = src.IndexOf("<sometag>")
   If index > 0 Then
      'Extract everything from the source beginning from the located index
      temp = src.SubString(index)
      'Locate the next index in order to narrow it down
      index = temp.IndexOf("</sometag>")
      temp = temp.SubString(0, index)
      
      'temp should now contain only the information found within a certain specific tag
   End If
End Sub

With a new slight modifications to the code by adding a few more IndexOf and SubString, you can easily locate and extract anything you whish to find.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok.
You can expand this part of the code to include the marked code I provided:

'Gather a list of items in folder, then remove file path, then display items
Dim FilesInDir As String() = Directory.GetFiles(".\Folder", "*.txt", SearchOption.AllDirectories)
Dim SFile As String

ListView1.Items.Clear()
For Each SFile In FilesInDir
	ListView1.Items.Add(New ListViewItem(New String() {SFile.Replace(".\Folder\", ""), CStr(FileLen(SFile))}))

	'' --------- Add This Code ----------
	Dim stream As New FileStream(".\Folder\" & SFile, FileMode.Open, FileAccess.Read)
	Dim reader As New StreamReader(stream)
	Dim line As String = reader.ReadLine 'This is just to skip the first line in the file

	'Change the number 5 value to match the number of lines to read from the file
	'If only one line is to be read, then remove the For...Next statement but keep what's in it.
	For i As Integer = 1 To 5
		'First check to see if the end of the file is reached
		If Not reader.EndOfStream Then
			'Read the next line from the file
			line = reader.ReadLine
			'Add the line to the SubItems collection of the last added item in the ListView
			ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(line)
		End If
	Next

	reader.Close()
	'' --------- End of Added Code ----------
Next
Smalls commented: Was very Helpful. tweaked it a lil to fit my needs. thank again +3
Oxiegen 88 Basically an Occasional Poster Featured Poster

You would normally get a list of command line arguments from an application by using the /? or -h/--help arguments.

Oxiegen 88 Basically an Occasional Poster Featured Poster

In the Form_Close event, you can use e.Cancel = True .
That will cancel the closing of the form no matter how the user initiates the closing of the form.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Anything is possible.

How are you populating the ListView in the first place?
Can't you also add the information for column 1 and 2 during the population phase?

If the folder is already known, then you can use the information in column 0 and call a function the performs the file reading and retrieving, while you are still populating the ListView.

No timer is needed.

Oxiegen 88 Basically an Occasional Poster Featured Poster

What bold things?

If you want to extract information from a HTML source, then the easiest solution would be to read the entire content into string using a StreamReader.
Once that is done, you can use string functions, like IndexOf and SubString, to locate and extract the information.

In other words, you will have to parse the source "manually".