• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

I have two tables and I need to display data from one table into a textbox

Basically this is a simple question as my knowledge on .net is limited.  I have two tables;

Main;
        ID (int obviously)
        LocationID (also int)
(there are more fields but arent relevent)

Location;
        LocationID
        LocationName

I have used the wizard to create a dataform and had all of the results displayed in textboxes.  My problem is that LocationID(Main) consists of a refernance no. refering to LocationName(Location) .  Unfortunatley all I can get it to display is the ID number and not the Location name as required.  I heard you use Look up tables?  As I say my knowledge is limited and any help would be much apprecitated.
0
matt_swinburne
Asked:
matt_swinburne
  • 15
  • 12
1 Solution
 
RonaldBiemansCommented:
Hi Matt, drag a combobox from the toolbox,

and do something like this (in the load event off your form)

combobox1.datasource = yourlocationtable
combobox1.displaymember = locationname
combobox1.Valuemember = locationID

I assumed that you have 2 dataadapters which load both the Main table and the location tabme
0
 
RonaldBiemansCommented:
Also I forgot, to probably want it to update the main table

so also add this

        combobox1.datasource = yourlocationtable
        combobox1.displaymember = locationname
        combobox1.Valuemember = locationID
        ComboBox1.DataBindings.Add("selectedvalue", yourmaintable, "LocationId")
0
 
RonaldBiemansCommented:
sorry  again (its early here)

combobox1.datasource = yourlocationtable
        combobox1.displaymember = "LocationName"
        combobox1.Valuemember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", yourmaintable, "LocationID")
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
matt_swinburneAuthor Commented:
Hi thanks for the prompt reply.  Tried the top help;

combobox1.datasource = yourlocationtable
combobox1.displaymember = locationname
combobox1.Valuemember = locationID

Edited it to this;

 ComboBox1.DataSource = DbLocation
 ComboBox1.DisplayMember = "locationname"
 ComboBox1.ValueMember = "locationID"

Now get;

An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll

Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource

(Remember my knowledge is basic so dont presume anything!!)

Thankyou for all help
0
 
RonaldBiemansCommented:
what is dblocation, the error says that it is not a datasource
0
 
matt_swinburneAuthor Commented:
dblocation is the dataadapter i renamed to be more clear.  I create the connection and drag the relevent tables onto the Form.  For example I start with a blank form and drag the table Main onto the form and rename the adapter as DbMain, then do the same for the table Locations, rename the adapter as DbLocations.  I then generate the dataset.  I then add a combo box to the form.  Add the code to the form load, and then get that error.  
0
 
matt_swinburneAuthor Commented:
I forgot to mention, I am dragging the tables from Server explorer
0
 
RonaldBiemansCommented:
the datasource of the combobox should be a table not a dataadapter.

so if your dataset is called ds

then use

combobox1.datasource = Ds.tables(0) ' or ds.tables(1)  depends on which one is the location table
0
 
matt_swinburneAuthor Commented:
Hi again!  Really apreciate the help as I am sure you find answering simple questions like these a chore.  But anyway, I now dont have any errors and am using this coding you supplied;

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables(1), "LocationID")
    End Sub

However nothing is populating the combobox and is just left blank.  Do remember post:

I create the connection and drag the relevent tables onto the Form.  For example I start with a blank form and drag the table Main onto the form and rename the adapter as DbMain, then do the same for the table Locations, rename the adapter as DbLocations.  I then generate the dataset.  I then add a combo box to the form.  Add the code to the form load, and then get that error

(This is all I do and am no longer using the wizard it is purely just a combobox on the form)

Thanks
0
 
RonaldBiemansCommented:
ok, you also have to fill the dataset with data, like

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dbmain.fill(dataset11,"Main")
        dblocation.fill(dataset11,"Location")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Location"), "LocationID")
    End Sub
0
 
matt_swinburneAuthor Commented:
OK.  Added that;


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Location")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables(1), "LocationID")
    End Sub

The combo box now displays the ID number not the location name
0
 
matt_swinburneAuthor Commented:
Sorry slight alteration;

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Location")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
      >>  ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Locations"), "LocationID")
    End Sub
0
 
RonaldBiemansCommented:
these don't match

 DbLocations.Fill(DataSet11, "Location")

 ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Locations"), "LocationID")

if the table is called "locations" in your typed dataset

than it should be

 DbLocations.Fill(DataSet11, "Locations")

or if it is called location

then it should be

 ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Location"), "LocationID")




0
 
RonaldBiemansCommented:
Sorry, this should probably be

ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Locations"), "LocationID")

this

ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Main"), "LocationID")

0
 
matt_swinburneAuthor Commented:
OK.  Changed name (so simple should have noticed)

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Locations")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Locations"), "LocationID")
    End Sub

However I am still getting the actual ID as oppose to the actual location name (i don't need relationships set up or anything do I) I just want the combobox to look up the Location ID in Main and then goto Locations table and get the corrosponding Location Name.

Sorry to take so long getting this right, perhaps I am being unclear, please ask me anything you need expanding on although I think you know exactly what I am doing here.

Once again thanks
0
 
matt_swinburneAuthor Commented:
OK;  Made change from Locations to Main

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Locations")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Main"), "LocationID")
    End Sub


Still getting the ID number and not the ID name
0
 
RonaldBiemansCommented:
the members are casesensitive

so locationname is different from LocationName use the exact name that is in your table. If that doesn't work could you then post your entire form (including the windows generated code)
0
 
matt_swinburneAuthor Commented:
How can I upload it?
0
 
RonaldBiemansCommented:
Just paste it in here
0
 
RonaldBiemansCommented:
just the code ofcourse  :-)
0
 
matt_swinburneAuthor Commented:
Sorry i thought you meant to upload the .net files and the database
0
 
RonaldBiemansCommented:
No just the form code (including the windows generated code)
0
 
matt_swinburneAuthor Commented:
OK,  This is the form code

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
    Friend WithEvents DbMain As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents DbLocations As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents DataSet11 As WindowsApplication3.DataSet1
    Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
        Me.DbMain = New System.Data.OleDb.OleDbDataAdapter
        Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbUpdateCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbDeleteCommand2 = New System.Data.OleDb.OleDbCommand
        Me.DbLocations = New System.Data.OleDb.OleDbDataAdapter
        Me.DataSet11 = New WindowsApplication3.DataSet1
        Me.ComboBox1 = New System.Windows.Forms.ComboBox
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'OleDbSelectCommand1
        '
        Me.OleDbSelectCommand1.CommandText = "SELECT BoxNumber, ClientName, CloseDate, DateIn, [Destroy this File], DestroyDate" & _
        ", DestroyFlag, FeeEarnerID, ID, LocationID, MatterNo, MatterTypeID, Notes, Offic" & _
        "eName, RecallRequest, RecallRequestDate, RemoveDate, StatusID, StoreDate, truede" & _
        "stroydate FROM Main"
        Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
        '
        'OleDbInsertCommand1
        '
        Me.OleDbInsertCommand1.CommandText = "INSERT INTO Main(BoxNumber, ClientName, CloseDate, DateIn, [Destroy this File], D" & _
        "estroyDate, DestroyFlag, FeeEarnerID, LocationID, MatterNo, MatterTypeID, Notes," & _
        " OfficeName, RecallRequest, RecallRequestDate, RemoveDate, StatusID, StoreDate, " & _
        "truedestroydate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?" & _
        ")"
        Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("BoxNumber", System.Data.OleDb.OleDbType.Integer, 0, "BoxNumber"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("ClientName", System.Data.OleDb.OleDbType.VarWChar, 50, "ClientName"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("CloseDate", System.Data.OleDb.OleDbType.DBDate, 0, "CloseDate"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DateIn", System.Data.OleDb.OleDbType.DBDate, 0, "DateIn"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Destroy_this_File", System.Data.OleDb.OleDbType.VarWChar, 50, "Destroy this File"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DestroyDate", System.Data.OleDb.OleDbType.DBDate, 0, "DestroyDate"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DestroyFlag", System.Data.OleDb.OleDbType.VarWChar, 50, "DestroyFlag"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("FeeEarnerID", System.Data.OleDb.OleDbType.Integer, 0, "FeeEarnerID"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("LocationID", System.Data.OleDb.OleDbType.Integer, 0, "LocationID"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("MatterNo", System.Data.OleDb.OleDbType.VarWChar, 10, "MatterNo"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("MatterTypeID", System.Data.OleDb.OleDbType.Integer, 0, "MatterTypeID"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Notes", System.Data.OleDb.OleDbType.VarWChar, 0, "Notes"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("OfficeName", System.Data.OleDb.OleDbType.Integer, 0, "OfficeName"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecallRequest", System.Data.OleDb.OleDbType.Boolean, 2, "RecallRequest"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecallRequestDate", System.Data.OleDb.OleDbType.DBDate, 0, "RecallRequestDate"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RemoveDate", System.Data.OleDb.OleDbType.DBDate, 0, "RemoveDate"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("StatusID", System.Data.OleDb.OleDbType.Integer, 0, "StatusID"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("StoreDate", System.Data.OleDb.OleDbType.DBDate, 0, "StoreDate"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("truedestroydate", System.Data.OleDb.OleDbType.DBDate, 0, "truedestroydate"))
        '
        'OleDbUpdateCommand1
        '
        Me.OleDbUpdateCommand1.CommandText = "UPDATE Main SET BoxNumber = ?, ClientName = ?, CloseDate = ?, DateIn = ?, [Destro" & _
        "y this File] = ?, DestroyDate = ?, DestroyFlag = ?, FeeEarnerID = ?, LocationID " & _
        "= ?, MatterNo = ?, MatterTypeID = ?, Notes = ?, OfficeName = ?, RecallRequest = " & _
        "?, RecallRequestDate = ?, RemoveDate = ?, StatusID = ?, StoreDate = ?, truedestr" & _
        "oydate = ? WHERE (ID = ?) AND (BoxNumber = ? OR ? IS NULL AND BoxNumber IS NULL)" & _
        " AND (ClientName = ? OR ? IS NULL AND ClientName IS NULL) AND (CloseDate = ? OR " & _
        "? IS NULL AND CloseDate IS NULL) AND (DateIn = ? OR ? IS NULL AND DateIn IS NULL" & _
        ") AND ([Destroy this File] = ? OR ? IS NULL AND [Destroy this File] IS NULL) AND" & _
        " (DestroyDate = ? OR ? IS NULL AND DestroyDate IS NULL) AND (DestroyFlag = ? OR " & _
        "? IS NULL AND DestroyFlag IS NULL) AND (FeeEarnerID = ? OR ? IS NULL AND FeeEarn" & _
        "erID IS NULL) AND (LocationID = ? OR ? IS NULL AND LocationID IS NULL) AND (Matt" & _
        "erNo = ? OR ? IS NULL AND MatterNo IS NULL) AND (MatterTypeID = ? OR ? IS NULL A" & _
        "ND MatterTypeID IS NULL) AND (OfficeName = ? OR ? IS NULL AND OfficeName IS NULL" & _
        ") AND (RecallRequest = ?) AND (RecallRequestDate = ? OR ? IS NULL AND RecallRequ" & _
        "estDate IS NULL) AND (RemoveDate = ? OR ? IS NULL AND RemoveDate IS NULL) AND (S" & _
        "tatusID = ? OR ? IS NULL AND StatusID IS NULL) AND (StoreDate = ? OR ? IS NULL A" & _
        "ND StoreDate IS NULL) AND (truedestroydate = ? OR ? IS NULL AND truedestroydate " & _
        "IS NULL)"
        Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("BoxNumber", System.Data.OleDb.OleDbType.Integer, 0, "BoxNumber"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("ClientName", System.Data.OleDb.OleDbType.VarWChar, 50, "ClientName"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("CloseDate", System.Data.OleDb.OleDbType.DBDate, 0, "CloseDate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DateIn", System.Data.OleDb.OleDbType.DBDate, 0, "DateIn"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Destroy_this_File", System.Data.OleDb.OleDbType.VarWChar, 50, "Destroy this File"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DestroyDate", System.Data.OleDb.OleDbType.DBDate, 0, "DestroyDate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("DestroyFlag", System.Data.OleDb.OleDbType.VarWChar, 50, "DestroyFlag"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("FeeEarnerID", System.Data.OleDb.OleDbType.Integer, 0, "FeeEarnerID"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("LocationID", System.Data.OleDb.OleDbType.Integer, 0, "LocationID"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("MatterNo", System.Data.OleDb.OleDbType.VarWChar, 10, "MatterNo"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("MatterTypeID", System.Data.OleDb.OleDbType.Integer, 0, "MatterTypeID"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Notes", System.Data.OleDb.OleDbType.VarWChar, 0, "Notes"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("OfficeName", System.Data.OleDb.OleDbType.Integer, 0, "OfficeName"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecallRequest", System.Data.OleDb.OleDbType.Boolean, 2, "RecallRequest"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecallRequestDate", System.Data.OleDb.OleDbType.DBDate, 0, "RecallRequestDate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("RemoveDate", System.Data.OleDb.OleDbType.DBDate, 0, "RemoveDate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("StatusID", System.Data.OleDb.OleDbType.Integer, 0, "StatusID"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("StoreDate", System.Data.OleDb.OleDbType.DBDate, 0, "StoreDate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("truedestroydate", System.Data.OleDb.OleDbType.DBDate, 0, "truedestroydate"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_BoxNumber", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "BoxNumber", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_BoxNumber1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "BoxNumber", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ClientName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ClientName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ClientName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ClientName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CloseDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CloseDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CloseDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CloseDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DateIn", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DateIn", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DateIn1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DateIn", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Destroy_this_File", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Destroy this File", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Destroy_this_File1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Destroy this File", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyFlag", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyFlag", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyFlag1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyFlag", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_FeeEarnerID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "FeeEarnerID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_FeeEarnerID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "FeeEarnerID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterNo", System.Data.OleDb.OleDbType.VarWChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterNo", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterNo1", System.Data.OleDb.OleDbType.VarWChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterNo", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterTypeID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterTypeID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterTypeID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterTypeID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_OfficeName", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OfficeName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_OfficeName1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OfficeName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequest", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequest", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequestDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequestDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequestDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequestDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RemoveDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RemoveDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RemoveDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RemoveDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StatusID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StatusID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StatusID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StatusID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StoreDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StoreDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StoreDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StoreDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_truedestroydate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "truedestroydate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_truedestroydate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "truedestroydate", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbDeleteCommand1
        '
        Me.OleDbDeleteCommand1.CommandText = "DELETE FROM Main WHERE (ID = ?) AND (BoxNumber = ? OR ? IS NULL AND BoxNumber IS " & _
        "NULL) AND (ClientName = ? OR ? IS NULL AND ClientName IS NULL) AND (CloseDate = " & _
        "? OR ? IS NULL AND CloseDate IS NULL) AND (DateIn = ? OR ? IS NULL AND DateIn IS" & _
        " NULL) AND ([Destroy this File] = ? OR ? IS NULL AND [Destroy this File] IS NULL" & _
        ") AND (DestroyDate = ? OR ? IS NULL AND DestroyDate IS NULL) AND (DestroyFlag = " & _
        "? OR ? IS NULL AND DestroyFlag IS NULL) AND (FeeEarnerID = ? OR ? IS NULL AND Fe" & _
        "eEarnerID IS NULL) AND (LocationID = ? OR ? IS NULL AND LocationID IS NULL) AND " & _
        "(MatterNo = ? OR ? IS NULL AND MatterNo IS NULL) AND (MatterTypeID = ? OR ? IS N" & _
        "ULL AND MatterTypeID IS NULL) AND (OfficeName = ? OR ? IS NULL AND OfficeName IS" & _
        " NULL) AND (RecallRequest = ?) AND (RecallRequestDate = ? OR ? IS NULL AND Recal" & _
        "lRequestDate IS NULL) AND (RemoveDate = ? OR ? IS NULL AND RemoveDate IS NULL) A" & _
        "ND (StatusID = ? OR ? IS NULL AND StatusID IS NULL) AND (StoreDate = ? OR ? IS N" & _
        "ULL AND StoreDate IS NULL) AND (truedestroydate = ? OR ? IS NULL AND truedestroy" & _
        "date IS NULL)"
        Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_BoxNumber", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "BoxNumber", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_BoxNumber1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "BoxNumber", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ClientName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ClientName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ClientName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ClientName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CloseDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CloseDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CloseDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CloseDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DateIn", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DateIn", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DateIn1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DateIn", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Destroy_this_File", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Destroy this File", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Destroy_this_File1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Destroy this File", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyFlag", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyFlag", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_DestroyFlag1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DestroyFlag", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_FeeEarnerID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "FeeEarnerID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_FeeEarnerID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "FeeEarnerID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterNo", System.Data.OleDb.OleDbType.VarWChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterNo", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterNo1", System.Data.OleDb.OleDbType.VarWChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterNo", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterTypeID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterTypeID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MatterTypeID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "MatterTypeID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_OfficeName", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OfficeName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_OfficeName1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OfficeName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequest", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequest", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequestDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequestDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RecallRequestDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecallRequestDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RemoveDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RemoveDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_RemoveDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RemoveDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StatusID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StatusID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StatusID1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StatusID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StoreDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StoreDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StoreDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "StoreDate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_truedestroydate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "truedestroydate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_truedestroydate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "truedestroydate", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
        "ocking Mode=0;Jet OLEDB:Database Password=;Data Source=""C:\Documents and Setting" & _
        "s\matthewm\Desktop\File Tracking.mdb"";Password=;Jet OLEDB:Engine Type=4;Jet OLED" & _
        "B:Global Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System" & _
        " database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLE" & _
        "DB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't" & _
        " Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Use" & _
        "r ID=Admin;Jet OLEDB:Encrypt Database=False"
        '
        'DbMain
        '
        Me.DbMain.DeleteCommand = Me.OleDbDeleteCommand1
        Me.DbMain.InsertCommand = Me.OleDbInsertCommand1
        Me.DbMain.SelectCommand = Me.OleDbSelectCommand1
        Me.DbMain.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Main", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("BoxNumber", "BoxNumber"), New System.Data.Common.DataColumnMapping("ClientName", "ClientName"), New System.Data.Common.DataColumnMapping("CloseDate", "CloseDate"), New System.Data.Common.DataColumnMapping("DateIn", "DateIn"), New System.Data.Common.DataColumnMapping("Destroy this File", "Destroy this File"), New System.Data.Common.DataColumnMapping("DestroyDate", "DestroyDate"), New System.Data.Common.DataColumnMapping("DestroyFlag", "DestroyFlag"), New System.Data.Common.DataColumnMapping("FeeEarnerID", "FeeEarnerID"), New System.Data.Common.DataColumnMapping("ID", "ID"), New System.Data.Common.DataColumnMapping("LocationID", "LocationID"), New System.Data.Common.DataColumnMapping("MatterNo", "MatterNo"), New System.Data.Common.DataColumnMapping("MatterTypeID", "MatterTypeID"), New System.Data.Common.DataColumnMapping("Notes", "Notes"), New System.Data.Common.DataColumnMapping("OfficeName", "OfficeName"), New System.Data.Common.DataColumnMapping("RecallRequest", "RecallRequest"), New System.Data.Common.DataColumnMapping("RecallRequestDate", "RecallRequestDate"), New System.Data.Common.DataColumnMapping("RemoveDate", "RemoveDate"), New System.Data.Common.DataColumnMapping("StatusID", "StatusID"), New System.Data.Common.DataColumnMapping("StoreDate", "StoreDate"), New System.Data.Common.DataColumnMapping("truedestroydate", "truedestroydate")})})
        Me.DbMain.UpdateCommand = Me.OleDbUpdateCommand1
        '
        'OleDbSelectCommand2
        '
        Me.OleDbSelectCommand2.CommandText = "SELECT LocationID, LocationName FROM Locations"
        Me.OleDbSelectCommand2.Connection = Me.OleDbConnection1
        '
        'OleDbInsertCommand2
        '
        Me.OleDbInsertCommand2.CommandText = "INSERT INTO Locations(LocationName) VALUES (?)"
        Me.OleDbInsertCommand2.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("LocationName", System.Data.OleDb.OleDbType.VarWChar, 50, "LocationName"))
        '
        'OleDbUpdateCommand2
        '
        Me.OleDbUpdateCommand2.CommandText = "UPDATE Locations SET LocationName = ? WHERE (LocationID = ?) AND (LocationName = " & _
        "? OR ? IS NULL AND LocationName IS NULL)"
        Me.OleDbUpdateCommand2.Connection = Me.OleDbConnection1
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("LocationName", System.Data.OleDb.OleDbType.VarWChar, 50, "LocationName"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationName", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbDeleteCommand2
        '
        Me.OleDbDeleteCommand2.CommandText = "DELETE FROM Locations WHERE (LocationID = ?) AND (LocationName = ? OR ? IS NULL A" & _
        "ND LocationName IS NULL)"
        Me.OleDbDeleteCommand2.Connection = Me.OleDbConnection1
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationID", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_LocationName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "LocationName", System.Data.DataRowVersion.Original, Nothing))
        '
        'DbLocations
        '
        Me.DbLocations.DeleteCommand = Me.OleDbDeleteCommand2
        Me.DbLocations.InsertCommand = Me.OleDbInsertCommand2
        Me.DbLocations.SelectCommand = Me.OleDbSelectCommand2
        Me.DbLocations.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Locations", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("LocationID", "LocationID"), New System.Data.Common.DataColumnMapping("LocationName", "LocationName")})})
        Me.DbLocations.UpdateCommand = Me.OleDbUpdateCommand2
        '
        'DataSet11
        '
        Me.DataSet11.DataSetName = "DataSet1"
        Me.DataSet11.Locale = New System.Globalization.CultureInfo("en-GB")
        '
        'ComboBox1
        '
        Me.ComboBox1.Location = New System.Drawing.Point(80, 88)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(176, 21)
        Me.ComboBox1.TabIndex = 0
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(360, 262)
        Me.Controls.Add(Me.ComboBox1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Locations")
        ComboBox1.DataSource = DataSet11.Tables(1)
        ComboBox1.DisplayMember = "LocationID"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Main"), "LocationID")
    End Sub
End Class



I don't think I need to give you anymore information on the actual database but please tell me if I do.

Thanks

Matt

0
 
RonaldBiemansCommented:
Maybe it is just a typo, but in the code you have send you use locationID for both display and value member

 ComboBox1.DisplayMember = "LocationID"
 ComboBox1.ValueMember = "LocationID"

and it should be


  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Locations")
        ComboBox1.DataSource = DataSet11.Tables("Locations")
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Main"), "LocationID")
    End Sub
0
 
RonaldBiemansCommented:
maybe also try reversing the statements

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DbMain.Fill(DataSet11, "Main")
        DbLocations.Fill(DataSet11, "Locations")
        ComboBox1.DisplayMember = "LocationName"
        ComboBox1.ValueMember = "LocationID"
        ComboBox1.DataSource = DataSet11.Tables("Locations")
        ComboBox1.DataBindings.Add("selectedvalue", DataSet11.Tables("Main"), "LocationID")
    End Sub
0
 
matt_swinburneAuthor Commented:
THANK YOU!!  I finally got there!

I changed

ComboBox1.DataSource = DataSet11.Tables(1)

To

ComboBox1.DataSource = DataSet11.Tables("Locations")

Muchly appreciate the help you gave me today.

0
 
RonaldBiemansCommented:
glad I could help :-)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 15
  • 12
Tackle projects and never again get stuck behind a technical roadblock.
Join Now