473,974 Members | 30,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does this error message mean?

I have developed a form that would allow the user to load and search a
database several ways, by data range, by specific number or all database
entries. I can successfully load any of the ways once. But when I click a
button labeled "Clear Form" and then attempt to load data again I get the
following error message:

An unhandled exception of type 'System.Argumen tException' occurred in system.
windows.forms.d ll

Additional information: This would cause two bindings in the collection to
bind to the same property.

The data bindings are all to text boxes and one checkbox. It is an MS ACCESS
database I am connecting to.

Imports System.Data
Imports System.Data.Ole Db

Public Class frmDataEntry
Inherits System.Windows. Forms.Form
Windows Form Designer generated Code
Dim dataset1 As New DataSet1
Dim ConnectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source = C:\AutoCAD Project\AutoCAD _Files.mdb; User ID=Admin"
Dim Connection1 As OleDbConnection = New OleDbConnection (ConnectionStri ng)
Private Sub frmDataEntry_Lo ad(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
lblNavLocation. Text = ""
End Sub
Public Sub btnLoad_Click(B yVal sender As System.Object, ByVal e As System.
EventArgs) Handles btnLoad.Click
Dim Command1 As OleDbCommand = New OleDbCommand("S ELECT * FROM
AutoCAD_Files", Connection1)

Connection1.Ope n()
Command1.Connec tion = Connection1

Dim daAdapter1 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter2 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter3 As OleDbDataAdapte r = New OleDbDataAdapte r

Dim IDbinding As New Binding("Text", dataset1, "AutoCAD_Files. ID")
Dim FileNamebinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_NAME")
Dim FileTitlebindin g As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_TITLE")
Dim FileDescbinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_DESCRIPTIO N")
Dim RevLetterbindin g As New Binding("Text", dataset1, "AutoCAD_Fi les.
REV_LETTER")
Dim OrigDatebinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
ORIGINATION_DAT E")
Dim DateModifiedbin ding As New Binding("Text", dataset1,
"AutoCAD_Files. DATE_MODIFIED")

' Check if a drawing number range is selected
If ComboBox1.Selec tedItem <> "" And ComboBox2.Selec tedItem <> "" Then
Dim FromRange As String
Dim ToRange As String
Dim SQLRange As String
FromRange = Trim(UCase(Comb oBox1.SelectedI tem))
ToRange = Trim(UCase(Comb oBox2.SelectedI tem))
SQLRange = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME BETWEEN
""" & FromRange & """ AND """ & ToRange & """"
Dim Command3 As OleDbCommand = New OleDbCommand(SQ LRange,
Connection1)
daAdapter3.Sele ctCommand = Command3
DataGrid1.Visib le = True
daAdapter3.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

' Check if a drawing number is specified
If txtDrawingNum.T ext <> "" Then
Dim SearchString As String
Dim SQL As String
SearchString = Trim(UCase(txtD rawingNum.Text) )
SQL = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME LIKE """ &
SearchString & """"
Dim command2 As OleDbCommand = New OleDbCommand(SQ L, Connection1)
daAdapter2.Sele ctCommand = command2
DataGrid1.Visib le = True
daAdapter2.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

daAdapter1.Sele ctCommand = Command1
DataGrid1.Visib le = True
daAdapter1.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )

editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)

Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
Private Sub btnClearForm_Cl ick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClearForm.Cl ick
dataset1.Clear( )
DataGrid1.Hide( )
lblNavLocation. Text = ""
txtNumber_of_Dr awings.Text = ""
txtDrawingNum.T ext = ""
ComboBox1.Text = ""
ComboBox2.Text = ""
End Sub
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
3 1901
Hi,

Everytime you press btnload the program binds a bunch of controls to
the data. Next time you press the button it tries to bind the data again
and you get an error. I would call the databindings.cl ear method before I
bind the data.

For example

editFILE_DESCRI PTION.DataBindi ngs.clear
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
Ken
---------------------
"Frustrated Developer via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote
in message news:54******** ***@DotNetMonst er.com...
I have developed a form that would allow the user to load and search a
database several ways, by data range, by specific number or all database
entries. I can successfully load any of the ways once. But when I click a
button labeled "Clear Form" and then attempt to load data again I get the
following error message:

An unhandled exception of type 'System.Argumen tException' occurred in
system.
windows.forms.d ll

Additional information: This would cause two bindings in the collection to
bind to the same property.

The data bindings are all to text boxes and one checkbox. It is an MS
ACCESS
database I am connecting to.

Imports System.Data
Imports System.Data.Ole Db

Public Class frmDataEntry
Inherits System.Windows. Forms.Form
Windows Form Designer generated Code
Dim dataset1 As New DataSet1
Dim ConnectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0;
Data
Source = C:\AutoCAD Project\AutoCAD _Files.mdb; User ID=Admin"
Dim Connection1 As OleDbConnection = New
OleDbConnection (ConnectionStri ng)
Private Sub frmDataEntry_Lo ad(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
lblNavLocation. Text = ""
End Sub
Public Sub btnLoad_Click(B yVal sender As System.Object, ByVal e As
System.
EventArgs) Handles btnLoad.Click
Dim Command1 As OleDbCommand = New OleDbCommand("S ELECT * FROM
AutoCAD_Files", Connection1)

Connection1.Ope n()
Command1.Connec tion = Connection1

Dim daAdapter1 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter2 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter3 As OleDbDataAdapte r = New OleDbDataAdapte r

Dim IDbinding As New Binding("Text", dataset1, "AutoCAD_Files. ID")
Dim FileNamebinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_NAME")
Dim FileTitlebindin g As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_TITLE")
Dim FileDescbinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_DESCRIPTIO N")
Dim RevLetterbindin g As New Binding("Text", dataset1,
"AutoCAD_Fi les.
REV_LETTER")
Dim OrigDatebinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
ORIGINATION_DAT E")
Dim DateModifiedbin ding As New Binding("Text", dataset1,
"AutoCAD_Files. DATE_MODIFIED")

' Check if a drawing number range is selected
If ComboBox1.Selec tedItem <> "" And ComboBox2.Selec tedItem <> ""
Then
Dim FromRange As String
Dim ToRange As String
Dim SQLRange As String
FromRange = Trim(UCase(Comb oBox1.SelectedI tem))
ToRange = Trim(UCase(Comb oBox2.SelectedI tem))
SQLRange = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME BETWEEN
""" & FromRange & """ AND """ & ToRange & """"
Dim Command3 As OleDbCommand = New OleDbCommand(SQ LRange,
Connection1)
daAdapter3.Sele ctCommand = Command3
DataGrid1.Visib le = True
daAdapter3.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1,
"AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

' Check if a drawing number is specified
If txtDrawingNum.T ext <> "" Then
Dim SearchString As String
Dim SQL As String
SearchString = Trim(UCase(txtD rawingNum.Text) )
SQL = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME LIKE """ &
SearchString & """"
Dim command2 As OleDbCommand = New OleDbCommand(SQ L,
Connection1)
daAdapter2.Sele ctCommand = command2
DataGrid1.Visib le = True
daAdapter2.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1,
"AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

daAdapter1.Sele ctCommand = Command1
DataGrid1.Visib le = True
daAdapter1.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )

editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)

Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
Private Sub btnClearForm_Cl ick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClearForm.Cl ick
dataset1.Clear( )
DataGrid1.Hide( )
lblNavLocation. Text = ""
txtNumber_of_Dr awings.Text = ""
txtDrawingNum.T ext = ""
ComboBox1.Text = ""
ComboBox2.Text = ""
End Sub
--
Message posted via http://www.dotnetmonster.com

Nov 21 '05 #2
Ken Tucker [MVP] wrote:
Hi,

Everytime you press btnload the program binds a bunch of controls to
the data. Next time you press the button it tries to bind the data again
and you get an error. I would call the databindings.cl ear method before I
bind the data.

For example

editFILE_DESCR IPTION.DataBind ings.clear
editFILE_DESCR IPTION.DataBind ings.Add(FileDe scbinding)

Ken
Thanks for the assistance. I've added the databindings.cl ear() statement to
all of my textbox fields. I'm able to use the combo box selection method
multiple times with no problem However, when I try to type in a specific
drawing number in the txtDrawingNum.t ext field and click btnLoad I get the
same dataset that I previously had from the combo boxes. Any ideas?

Dim dataset1 As New DataSet1
Dim ConnectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source = C:\AutoCAD Project\AutoCAD _Files.mdb; User ID=Admin"
Dim Connection1 As OleDbConnection = New OleDbConnection (ConnectionStri ng)

Public Sub btnLoad_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLoad.Click
Dim Command1 As OleDbCommand = New OleDbCommand("S ELECT * FROM
AutoCAD_Files", Connection1)

Connection1.Ope n()
Command1.Connec tion = Connection1

Dim daAdapter1 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter2 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter3 As OleDbDataAdapte r = New OleDbDataAdapte r

Dim IDbinding As New Binding("Text", dataset1, "AutoCAD_Files. ID")
Dim FileNamebinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_NAME")
Dim FileTitlebindin g As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_TITLE")
Dim FileDescbinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
FILE_DESCRIPTIO N")
Dim RevLetterbindin g As New Binding("Text", dataset1, "AutoCAD_Fi les.
REV_LETTER")
Dim OrigDatebinding As New Binding("Text", dataset1, "AutoCAD_Fi les.
ORIGINATION_DAT E")
Dim DateModifiedbin ding As New Binding("Text", dataset1,
"AutoCAD_Files. DATE_MODIFIED")

' Check if a drawing number range is selected
If ComboBox1.Selec tedItem <> "" And ComboBox2.Selec tedItem <> "" Then
Dim FromRange As String
Dim ToRange As String
Dim SQLRange As String
FromRange = Trim(UCase(Comb oBox1.SelectedI tem))
ToRange = Trim(UCase(Comb oBox2.SelectedI tem))
SQLRange = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME BETWEEN
""" & FromRange & """ AND """ & ToRange & """"
Dim Command3 As OleDbCommand = New OleDbCommand(SQ LRange,
Connection1)
daAdapter3.Sele ctCommand = Command3
DataGrid1.Visib le = True
daAdapter3.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

' Check if a drawing number is specified
If txtDrawingNum.T ext <> "" Then
Dim SearchString As String
Dim SQL As String
SearchString = Trim(UCase(txtD rawingNum.Text) )
SQL = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME LIKE """ &
SearchString & """"
Dim command2 As OleDbCommand = New OleDbCommand(SQ L, Connection1)
daAdapter2.Sele ctCommand = command2
DataGrid1.Visib le = True
daAdapter2.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

daAdapter1.Sele ctCommand = Command1
DataGrid1.Visib le = True
daAdapter1.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )

editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)

Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End Sub---------------------
I have developed a form that would allow the user to load and search a
database several ways, by data range, by specific number or all database

[quoted text clipped - 152 lines]
ComboBox2.Text = ""
End Sub

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #3
Hi,

I would add another textbox for searching. Here is an example
on finding records

http://www.windowsformsdatagridhelp....7-26a58190eb5c

Ken
---------------------
"Frustrated Developer via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote
in message news:54******** ***@DotNetMonst er.com...
Ken Tucker [MVP] wrote:
Hi,

Everytime you press btnload the program binds a bunch of controls
to
the data. Next time you press the button it tries to bind the data again
and you get an error. I would call the databindings.cl ear method before I
bind the data.

For example

editFILE_DESC RIPTION.DataBin dings.clear
editFILE_DESC RIPTION.DataBin dings.Add(FileD escbinding)

Ken


Thanks for the assistance. I've added the databindings.cl ear() statement
to
all of my textbox fields. I'm able to use the combo box selection method
multiple times with no problem However, when I try to type in a specific
drawing number in the txtDrawingNum.t ext field and click btnLoad I get the
same dataset that I previously had from the combo boxes. Any ideas?

Dim dataset1 As New DataSet1
Dim ConnectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source = C:\AutoCAD Project\AutoCAD _Files.mdb; User ID=Admin"
Dim Connection1 As OleDbConnection = New OleDbConnection (ConnectionStri ng)

Public Sub btnLoad_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLoad.Click
Dim Command1 As OleDbCommand = New OleDbCommand("S ELECT * FROM
AutoCAD_Files", Connection1)

Connection1.Ope n()
Command1.Connec tion = Connection1

Dim daAdapter1 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter2 As OleDbDataAdapte r = New OleDbDataAdapte r
Dim daAdapter3 As OleDbDataAdapte r = New OleDbDataAdapte r

Dim IDbinding As New Binding("Text", dataset1, "AutoCAD_Files. ID")
Dim FileNamebinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_NAME")
Dim FileTitlebindin g As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_TITLE")
Dim FileDescbinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
FILE_DESCRIPTIO N")
Dim RevLetterbindin g As New Binding("Text", dataset1,
"AutoCAD_Fi les.
REV_LETTER")
Dim OrigDatebinding As New Binding("Text", dataset1,
"AutoCAD_Fi les.
ORIGINATION_DAT E")
Dim DateModifiedbin ding As New Binding("Text", dataset1,
"AutoCAD_Files. DATE_MODIFIED")

' Check if a drawing number range is selected
If ComboBox1.Selec tedItem <> "" And ComboBox2.Selec tedItem <> ""
Then
Dim FromRange As String
Dim ToRange As String
Dim SQLRange As String
FromRange = Trim(UCase(Comb oBox1.SelectedI tem))
ToRange = Trim(UCase(Comb oBox2.SelectedI tem))
SQLRange = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME BETWEEN
""" & FromRange & """ AND """ & ToRange & """"
Dim Command3 As OleDbCommand = New OleDbCommand(SQ LRange,
Connection1)
daAdapter3.Sele ctCommand = Command3
DataGrid1.Visib le = True
daAdapter3.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1,
"AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

' Check if a drawing number is specified
If txtDrawingNum.T ext <> "" Then
Dim SearchString As String
Dim SQL As String
SearchString = Trim(UCase(txtD rawingNum.Text) )
SQL = "SELECT * FROM AutoCAD_Files WHERE FILE_NAME LIKE """ &
SearchString & """"
Dim command2 As OleDbCommand = New OleDbCommand(SQ L,
Connection1)
daAdapter2.Sele ctCommand = command2
DataGrid1.Visib le = True
daAdapter2.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )
editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)
Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1,
"AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End If

daAdapter1.Sele ctCommand = Command1
DataGrid1.Visib le = True
daAdapter1.Fill (dataset1, "AutoCAD_Files" )
DataGrid1.SetDa taBinding(datas et1, "AutoCAD_Files" )

editID.DataBind ings.Clear()
editID.DataBind ings.Add(IDbind ing)
editFILE_NAME.D ataBindings.Cle ar()
editFILE_NAME.D ataBindings.Add (FileNamebindin g)
editFILE_TITLE. DataBindings.Cl ear()
editFILE_TITLE. DataBindings.Ad d(FileTitlebind ing)
editFILE_DESCRI PTION.DataBindi ngs.Clear()
editFILE_DESCRI PTION.DataBindi ngs.Add(FileDes cbinding)
editREV_LETTER. DataBindings.Cl ear()
editREV_LETTER. DataBindings.Ad d(RevLetterbind ing)
editORIGINATION _DATE.DataBindi ngs.Clear()
editORIGINATION _DATE.DataBindi ngs.Add(OrigDat ebinding)
editDATE_MODIFI ED.DataBindings .Clear()
editDATE_MODIFI ED.DataBindings .Add(DateModifi edbinding)

Me.lblNavLocati on.Text = (((Me.BindingCo ntext(dataset1,
"AutoCAD_Files" ).Position + 1).ToString + " of ") _
+ Me.BindingConte xt(dataset1, "AutoCAD_Files" ).Count.
ToString)
Connection1.Clo se()
Exit Sub
End Sub
---------------------
I have developed a form that would allow the user to load and search a
database several ways, by data range, by specific number or all database

[quoted text clipped - 152 lines]
ComboBox2.Text = ""
End Sub

--
Message posted via http://www.dotnetmonster.com

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
6957
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some errors. It uses fileperms() to get the permissions of the file, and it includes that info in any error message. Today I'm getting the following error message. I've used SmartFtp to go in and set the test file's permissions to 777, but in this error...
72
5957
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for example, between a C/C++ programmers with a few weeks of experience and a C/C++ programmer with years of experience. You don't really need to understand the subtle details or use the obscure features of either language
6
23732
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really three and they validate a four items
121
10314
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
13
5085
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
8
11452
by: kevin | last post by:
I have a form and in the form I have a sub that uses a class I instantiate using visual basic code: Public oCP As New Rs232 'instantiate the comm port I need to share this sub with another form so to declare the sub I use visual basic code: Public Shared Function IsPortAvailable(ByVal ComPort As Integer) As Boolean
669
26688
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
13
520
by: Protoman | last post by:
I'm getting an error: 10 C:\Dev-Cpp\Enigma.cpp no match for 'operator<' in 'i < (+cleartext)->std::basic_string<_CharT, _Traits, _Alloc>::end ()' Code: Enigma.hpp -------------------------- #pragma once
6
2446
by: Bint | last post by:
I'm getting this returned from a PHP script. What does this mean? <b>Parse error</b>: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in <b>/ho Thanks B
5
13517
by: =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post by:
Hi, I would like to have someone comments on what's the best practice defining error codes in C. Here's what I think: solution A: using enum pros: type safe. better for debug (some debugger will show the name not only the value) cons: enum can not be forward declared which makes all error codes
0
10347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10901
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8453
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6543
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4726
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.