473,808 Members | 2,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Error

Hey group,

I keep getting the following error:

"An unhandled exception of type 'System.IndexOu tOfRangeExcepti on' occurred
in system.data.dll
Additional information: There is no row at position 1."

on the following line of code:

Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position
<> -1 And Not mlLoading Then

dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub

Could anybody shed any light as to what this error is or why its happening?

Many Thanks
MCN
Nov 20 '05 #1
20 2037
Hi Mad,

This is not knowing, this is guessing.

Can you do a BindingContext( ds.Tables"yourt able").EndCurre ntEdit() before
that row.

Maybe did you create a new row with the BindingContext and is it not yet in
your table.

Just a gues do not shoot when it is wrong

Cor
Nov 20 '05 #2
Sorry Cor, I don`t get what you mean?

I seem to have this problem on all my bindings on all my tables. What code
do I need to put where? Its strange coz it only seems to happen on my
Position_Change d code:(

Many Thanks Again
MCN

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ec******** ******@TK2MSFTN GP10.phx.gbl...
Hi Mad,

This is not knowing, this is guessing.

Can you do a BindingContext( ds.Tables"yourt able").EndCurre ntEdit() before
that row.

Maybe did you create a new row with the BindingContext and is it not yet in your table.

Just a gues do not shoot when it is wrong

Cor

Nov 20 '05 #3
Cor,

I know theres a fair bit but i`ve attached my code incase it might help?
Also any suggestions anybody has would be welcomed for any area of code? im
not sure wether im still classed as a newbie or not now:)

Many Thanks
MCN

Private Sub frmMainMenuPass words_Load(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
cmDsCentrexLine s = BindingContext( dsCentrexLines, "Centrexlin es")
cmDsCentrexLine s = BindingContext( dsMobiles, "MobilePhon es")
cmDsISDNLines = BindingContext( dsISDNLines, "ISDNLines" )
cmDsBTLines = BindingContext( dsBTLines, "BTLines")
mlLoading = True
'Start of Fill Datasets
Try
dsCentrexLines. EnforceConstrai nts = False
Try
Me.odcPhones.Op en()
'Fill CentrexLines Copier Datasets
Me.odaCommsType .Fill(dsCentrex Lines)
Me.odaSites.Fil l(dsCentrexLine s)
Me.odaDepartmen ts.Fill(dsCentr exLines)
Me.odaPrimaryUs er.Fill(dsCentr exLines)
Me.odaCentrexLi nes.Fill(dsCent rexLines)
'Fill Mobile Phone Datasets
Me.odaGPRSTarri f.Fill(dsMobile s)
Me.odaDepartmen ts.Fill(dsMobil es)
Me.odaPrimaryUs er.Fill(dsMobil es)
Me.odaMobiles.F ill(dsMobiles)
'Fill ISDN Line Datasets
Me.odaSites.Fil l(dsISDNLines)
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaPrimaryUs er.Fill(dsISDNL ines)
Me.odaCommsType .Fill(dsISDNLin es)
Me.odaCommsCarr ier.Fill(dsISDN Lines)
Me.odaISDNLines .Fill(dsISDNLin es)
'Fill BT Line Datasets
Me.odaSites.Fil l(dsBTLines)
Me.odaPrimaryUs er.Fill(dsBTLin es)
Me.odaCommsType .Fill(dsBTLines )
Me.odaBTLines.F ill(dsBTLines)
Catch fillException As System.Exceptio n
Throw fillException
Finally
'To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
'dsCentrexLines .EnforceConstra ints = True
'dsMobiles.Enfo rceConstraints = True
'dsISDNLines.En forceConstraint s = True
'dsBTLines.Enfo rceConstraints = True
Me.odcPhones.Cl ose()
End Try
Catch eLoad As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eLoad.Me ssage)
Finally
mlLoading = False
End Try
'End of Fill Datasets
End Sub

'Start of Position Changed Code - Centrexlines
Private Sub cmdsCentrexLine s_PositionChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cmDsCentrexLine s.PositionChang ed
dsCentrexLines_ PositionChanged ()
End Sub

Private Sub cboCentrexlines Type_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then

dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("CommsTypeI D") =
Me.cboCentrexLi nesType.Selecte dValue
End If
End Sub

Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then

dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub

Private Sub cboCentrexlines Department_Sele ctedIndexChange d(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then

dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("DepartmentID" ) =
Me.cboCentrexLi nesDepartment.S electedValue
End If
End Sub

Private Sub cboCentrexLines ite_SelectedInd exChanged(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Site.SelectedIn dexChanged
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then

dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("SitesID") =
Me.cboCentrexLi nesSite.Selecte dValue
End If
End Sub

Private Sub dsCentrexLines_ PositionChanged ()
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
Then
Me.cboCentrexLi nesType.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("CommsTypeI D")
Me.cboCentrexLi nesPrimaryUser. SelectedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID")
Me.cboCentrexLi nesDepartment.S electedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("DepartmentID" )
Me.cboCentrexLi nesSite.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("SitesID")
End If
End Sub
'End of Position Changed Code - Centrexlines

'Start of Position Changed Code - Mobile Phones
Private Sub cmdsMobiles_Pos itionChanged(By Val sender As Object, ByVal e
As System.EventArg s) Handles cmdsMobilePhone s.PositionChang ed
dsMobiles_Posit ionChanged()
End Sub

Private Sub cboMobilePhones PrimaryUser_Sel ectedIndexChang ed(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones PrimaryUser.Sel ectedIndexChang ed
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("UsersID") =
Me.cboMobilePho nesPrimaryUser. SelectedValue
End If
End Sub

Private Sub cboMobilePhones Department_Sele ctedIndexChange d(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("DepartmentID" ) =
Me.cboMobilePho nesDepartment.S electedValue
End If
End Sub

Private Sub cboMobilePhoneG PRSTarrif_Selec tedIndexChanged (ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones GPRSTariff.Sele ctedIndexChange d
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("GPRSTarrifID" ) =
Me.cboMobilePho nesGPRSTariff.S electedValue
End If
End Sub

Private Sub dsMobiles_Posit ionChanged()
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 Then
Me.cboMobilePho nesPrimaryUser. SelectedValue =
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("UsersID")
Me.cboMobilePho nesDepartment.S electedValue =
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("DepartmentID" )
Me.cboMobilePho nesGPRSTariff.S electedValue =
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("GPRSTariffID" )
End If
End Sub
'End of Position Changed Code - Mobile Phones

'Start of Position Changed Code - ISDN Lines
Private Sub cmdsISDNLines_P ositionChanged( ByVal sender As Object, ByVal
e As System.EventArg s) Handles cmDsISDNLines.P ositionChanged
dsISDNLines_Pos itionChanged()
End Sub

Private Sub cboISDNLinesPri maryUser_Select edIndexChanged( ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesPri maryUser.Select edIndexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("U sersID") =
Me.cboISDNLines PrimaryUser.Sel ectedValue
End If
End Sub

Private Sub cboISDNLinesDep artment_Selecte dIndexChanged(B yVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesDep artment.Selecte dIndexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("D epartmentID") =
Me.cboISDNLines Department.Sele ctedValue
End If
End Sub

Private Sub cboIDSNLinesTyp e_SelectedIndex Changed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesTyp e.SelectedIndex Changed
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsTypeID") =
Me.cboISDNLines Type.SelectedVa lue
End If
End Sub

Private Sub cboIDSNLinesSit e_SelectedIndex Changed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesSit e.SelectedIndex Changed
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("S itesID") = Me.cboISDNLines Site.SelectedVa lue
End If
End Sub

Private Sub cboIDSNLinesCar rier_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesCar rier.SelectedIn dexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsCarrierID") =
Me.cboISDNLines Carrier.Selecte dValue
End If
End Sub

Private Sub dsISDNLines_Pos itionChanged()
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 Then
Me.cboISDNLines PrimaryUser.Sel ectedValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("U sersID")
Me.cboISDNLines Department.Sele ctedValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("D epartmentID")
Me.cboISDNLines Carrier.Selecte dValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("L ineCarrierID")
Me.cboISDNLines Site.SelectedVa lue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("S iteID")
Me.cboISDNLines Carrier.Selecte dValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsCarrierID")
End If
End Sub
'End of Position Changed Code - ISDN Lines

'Start of Position Changed Code - BT Lines
Private Sub cmdsBTLines_Pos itionChanged(By Val sender As Object, ByVal e
As System.EventArg s) Handles cmDsBTLines.Pos itionChanged
dsBTLines_Posit ionChanged()
End Sub

Private Sub cboBTLinesPrima ryUser_Selected IndexChanged(By Val sender As
Object, ByVal e As System.EventArg s) Handles
cboBTLinesPrima ryUser.Selected IndexChanged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Use rsID") =
Me.cboBTLinesPr imaryUser.Selec tedValue
End If
End Sub

Private Sub cboBTLinesType_ SelectedIndexCh anged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboBTLinesType. SelectedIndexCh anged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Typ eID") = Me.cboBTLinesTy pe.SelectedValu e
End If
End Sub

Private Sub cboBTLinesSite_ SelectedIndexCh anged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboBTLinesSite. SelectedIndexCh anged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Sit eID") = Me.cboBTLinesSi te.SelectedValu e
End If
End Sub

Private Sub dsBTLines_Posit ionChanged()
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 Then
Me.cboBTLinesPr imaryUser.Selec tedValue =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Use rsID")
Me.cboBTLinesTy pe.SelectedValu e =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Lin eCarrierID")
Me.cboBTLinesSi te.SelectedValu e =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Sit eID")
End If
End Sub
'End of Position Changed Code - BT Lines

'CentrexLines Code Start
Private Sub btnCentrexlines Delete_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Delete.Click
If (Me.BindingCont ext(dsCentrexLi nes, "Centrexlines") .Count > 0)
Then
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .RemoveAt(Me.Bi ndingContext(ds CentrexLines,
"Centrexlines") .Position)
End If
End Sub

Private Sub btnCentrexlines Add_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Add.Click
txtCentrexLines ID.Enabled = True
txtCentrexLines Extension.Enabl ed = True
txtCentrexLines PublicDialNumbe r.Enabled = True
txtCentrexLines Notes.Enabled = True
txtCentrexLines CabNumber.Enabl ed = True
txtCentrexLines PatchPoint.Enab led = True
txtCentrexLines DP.Enabled = True
txtCentrexLines Pair.Enabled = True
txtCentrexLines Exchange.Enable d = True
txtCentrexLines PatchPanel.Enab led = True
dtpCentrexLines InstallationDat e.Enabled = True
cboCentrexLines DDI.Enabled = True
cboCentrexLines Type.Enabled = True
cboCentrexLines Department.Enab led = True
cboCentrexLines Site.Enabled = True
cboCentrexLines PrimaryUser.Ena bled = True
Try
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .EndCurrentEdit ()
Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .AddNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub

Private Sub btnCentrexlines Cancel_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Cancel.Click
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .CancelCurrentE dit()
txtCentrexLines ID.Enabled = False
txtCentrexLines Extension.Enabl ed = False
txtCentrexLines PublicDialNumbe r.Enabled = False
txtCentrexLines Notes.Enabled = False
txtCentrexLines CabNumber.Enabl ed = False
txtCentrexLines PatchPoint.Enab led = False
txtCentrexLines DP.Enabled = False
txtCentrexLines Pair.Enabled = False
txtCentrexLines Exchange.Enable d = False
txtCentrexLines PatchPanel.Enab led = False
dtpCentrexLines InstallationDat e.Enabled = False
cboCentrexLines DDI.Enabled = False
cboCentrexLines Type.Enabled = False
cboCentrexLines Department.Enab led = False
cboCentrexLines Site.Enabled = False
cboCentrexLines PrimaryUser.Ena bled = False
End Sub

Private Sub btnCentrexlines Update_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Update.Click
Try
Dim objDataSetChang es As Excellence.NET. dsCentrexLines = New
Excellence.NET. dsCentrexLines( )
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .EndCurrentEdit ()
objDataSetChang es = CType(dsCentrex Lines.GetChange s,
Excellence.NET. dsCentrexLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsCentrexLines ) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaCommsType .Fill(dsCentrex Lines)
Me.odaSites.Fil l(dsCentrexLine s)
Me.odaDepartmen ts.Fill(dsCentr exLines)
Me.odaPrimaryUs er.Fill(dsCentr exLines)
Me.odaCentrexLi nes.Fill(dsCent rexLines)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsCentrexLines. Merge(objDataSe tChanges)
dsCentrexLines. AcceptChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtCentrexLines ID.Enabled = False
txtCentrexLines Extension.Enabl ed = False
txtCentrexLines PublicDialNumbe r.Enabled = False
txtCentrexLines Notes.Enabled = False
txtCentrexLines CabNumber.Enabl ed = False
txtCentrexLines PatchPoint.Enab led = False
txtCentrexLines DP.Enabled = False
txtCentrexLines Pair.Enabled = False
txtCentrexLines Exchange.Enable d = False
txtCentrexLines PatchPanel.Enab led = False
dtpCentrexLines InstallationDat e.Enabled = False
cboCentrexLines DDI.Enabled = False
cboCentrexLines Type.Enabled = False
cboCentrexLines Department.Enab led = False
cboCentrexLines Site.Enabled = False
cboCentrexLines PrimaryUser.Ena bled = False
End Sub

Private Sub btnCentrexlines Edit_Click(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Edit.Click
txtCentrexLines ID.Enabled = True
txtCentrexLines Extension.Enabl ed = True
txtCentrexLines PublicDialNumbe r.Enabled = True
txtCentrexLines Notes.Enabled = True
txtCentrexLines CabNumber.Enabl ed = True
txtCentrexLines PatchPoint.Enab led = True
txtCentrexLines DP.Enabled = True
txtCentrexLines Pair.Enabled = True
txtCentrexLines Exchange.Enable d = True
txtCentrexLines PatchPanel.Enab led = True
dtpCentrexLines InstallationDat e.Enabled = True
cboCentrexLines DDI.Enabled = True
cboCentrexLines Type.Enabled = True
cboCentrexLines Department.Enab led = True
cboCentrexLines Site.Enabled = True
cboCentrexLines PrimaryUser.Ena bled = True
End Sub
'Centrexlines Code Finish

'Mobile Phones Code Start
Private Sub btnMobilePhones Delete_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Delete.Click
If (Me.BindingCont ext(dsMobiles, "MobilePhones") .Count > 0) Then
Me.BindingConte xt(dsMobiles,
"MobilePhones") .RemoveAt(Me.Bi ndingContext(ds Mobiles,
"MobilePhones") .Position)
End If
End Sub

Private Sub btnMobilePhones Add_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Add.Click
txtMobilePhones ID.Enabled = True
txtMobilePhones MobileNumber.En abled = True
txtMobilePhones Data.Enabled = True
txtMobilePhones Fax.Enabled = True
txtMobilePhones SDC.Enabled = True
dtpMobilePhones ContractStartDa te.Enabled = True
cboMobilePhones Department.Enab led = True
cboMobilePhones PrimaryUser.Ena bled = True
cboMobilePhones GPRSTariff.Enab led = True
Try
Me.BindingConte xt(dsMobiles, "MobilePhones") .EndCurrentEdit ()
Me.BindingConte xt(dsMobiles, "MobilePhones") .AddNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub

Private Sub btnMobilePhones Cancel_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Cancel.Click
Me.BindingConte xt(dsMobiles, "MobilePhones") .CancelCurrentE dit()
txtMobilePhones ID.Enabled = False
txtMobilePhones MobileNumber.En abled = False
txtMobilePhones Data.Enabled = False
txtMobilePhones Fax.Enabled = False
txtMobilePhones SDC.Enabled = False
dtpMobilePhones ContractStartDa te.Enabled = False
cboMobilePhones Department.Enab led = False
cboMobilePhones PrimaryUser.Ena bled = False
cboMobilePhones GPRSTariff.Enab led = False
End Sub

Private Sub btnMobilePhones Update_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Update.Click
Try
Dim objDataSetChang es As Excellence.NET. dsMobiles = New
Excellence.NET. dsMobiles()
Me.BindingConte xt(dsMobiles, "MobilePhones") .EndCurrentEdit ()
objDataSetChang es = CType(dsMobiles .GetChanges,
Excellence.NET. dsMobiles)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsMobiles) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaDepartmen ts.Fill(dsMobil es)
Me.odaPrimaryUs er.Fill(dsMobil es)
Me.odaGPRSTarri f.Fill(dsMobile s)
Me.odaMobiles.F ill(dsMobiles)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsMobiles.Merge (objDataSetChan ges)
dsMobiles.Accep tChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtMobilePhones ID.Enabled = False
txtMobilePhones MobileNumber.En abled = False
txtMobilePhones Data.Enabled = False
txtMobilePhones Fax.Enabled = False
txtMobilePhones SDC.Enabled = False
dtpMobilePhones ContractStartDa te.Enabled = False
cboMobilePhones Department.Enab led = False
cboMobilePhones PrimaryUser.Ena bled = False
cboMobilePhones GPRSTariff.Enab led = False
End Sub

Private Sub btnMobilePhones Edit_Click(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Edit.Click
txtMobilePhones ID.Enabled = True
txtMobilePhones MobileNumber.En abled = True
txtMobilePhones Data.Enabled = True
txtMobilePhones Fax.Enabled = True
txtMobilePhones SDC.Enabled = True
dtpMobilePhones ContractStartDa te.Enabled = True
cboMobilePhones Department.Enab led = True
cboMobilePhones PrimaryUser.Ena bled = True
cboMobilePhones GPRSTariff.Enab led = True
End Sub
'Mobile Phones Code Finish

'ISDN Lines Code Start
Private Sub btnISDNLinesDel ete_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesDel ete.Click
If (Me.BindingCont ext(dsISDNLines , "ISDNLines").Co unt > 0) Then
Me.BindingConte xt(dsISDNLines,
"ISDNLines").Re moveAt(Me.Bindi ngContext(dsISD NLines, "ISDNLines").Po sition)
End If
End Sub

Private Sub btnISDNLinesAdd _Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnISDNLinesAdd .Click
txtISDNLinesID. Enabled = True
txtISDNLinesPri maryNumber.Enab led = True
txtISDNLinesSec ondaryNumber.En abled = True
txtISDNLinesNot es.Enabled = True
txtISDNLinesCab .Enabled = True
txtISDNLinesPat ch.Enabled = True
txtISDNLinesPoi nt.Enabled = True
txtISDNLinesDP. Enabled = True
txtISDNLinesPai r.Enabled = True
txtISDNLinesExc hange.Enabled = True
cboISDNLinesPri maryUser.Enable d = True
cboISDNLinesDep artment.Enabled = True
cboISDNLinesTyp e.Enabled = True
cboISDNLinesCar rier.Enabled = True
cboISDNLinesSit e.Enabled = True
dtpISDNLinesIns tallationDate.E nabled = True
Try
Me.BindingConte xt(dsISDNLines, "ISDNLines").En dCurrentEdit()
Me.BindingConte xt(dsISDNLines, "ISDNLines").Ad dNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub

Private Sub btnISDNLinesCan cel_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesCan cel.Click
Me.BindingConte xt(dsISDNLines, "ISDNLines").Ca ncelCurrentEdit ()
txtISDNLinesID. Enabled = False
txtISDNLinesPri maryNumber.Enab led = False
txtISDNLinesSec ondaryNumber.En abled = False
txtISDNLinesNot es.Enabled = False
txtISDNLinesCab .Enabled = False
txtISDNLinesPat ch.Enabled = False
txtISDNLinesPoi nt.Enabled = False
txtISDNLinesDP. Enabled = False
txtISDNLinesPai r.Enabled = False
txtISDNLinesExc hange.Enabled = False
cboISDNLinesPri maryUser.Enable d = False
cboISDNLinesDep artment.Enabled = False
cboISDNLinesTyp e.Enabled = False
cboISDNLinesCar rier.Enabled = False
cboISDNLinesSit e.Enabled = False
dtpISDNLinesIns tallationDate.E nabled = False
End Sub

Private Sub btnISDNLinesUpd ate_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesUpd ate.Click
Try
Dim objDataSetChang es As Excellence.NET. dsISDNLines = New
Excellence.NET. dsISDNLines()
Me.BindingConte xt(dsISDNLines, "ISDNLines").En dCurrentEdit()
objDataSetChang es = CType(dsISDNLin es.GetChanges,
Excellence.NET. dsISDNLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsISDNLines) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaCommsType .Fill(dsISDNLin es)
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaPrimaryUs er.Fill(dsISDNL ines)
Me.odaCommsCarr ier.Fill(dsISDN Lines)
Me.odaISDNLines .Fill(dsISDNLin es)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsISDNLines.Mer ge(objDataSetCh anges)
dsISDNLines.Acc eptChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtISDNLinesID. Enabled = False
txtISDNLinesPri maryNumber.Enab led = False
txtISDNLinesSec ondaryNumber.En abled = False
txtISDNLinesNot es.Enabled = False
txtISDNLinesCab .Enabled = False
txtISDNLinesPat ch.Enabled = False
txtISDNLinesPoi nt.Enabled = False
txtISDNLinesDP. Enabled = False
txtISDNLinesPai r.Enabled = False
txtISDNLinesExc hange.Enabled = False
cboISDNLinesPri maryUser.Enable d = False
cboISDNLinesDep artment.Enabled = False
cboISDNLinesTyp e.Enabled = False
cboISDNLinesCar rier.Enabled = False
cboISDNLinesSit e.Enabled = False
dtpISDNLinesIns tallationDate.E nabled = False
End Sub

Private Sub btnISDNLinesEdi t_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnISDNLinesEdi t.Click
txtISDNLinesID. Enabled = True
txtISDNLinesPri maryNumber.Enab led = True
txtISDNLinesSec ondaryNumber.En abled = True
txtISDNLinesNot es.Enabled = True
txtISDNLinesCab .Enabled = True
txtISDNLinesPat ch.Enabled = True
txtISDNLinesPoi nt.Enabled = True
txtISDNLinesDP. Enabled = True
txtISDNLinesPai r.Enabled = True
txtISDNLinesExc hange.Enabled = True
cboISDNLinesPri maryUser.Enable d = True
cboISDNLinesDep artment.Enabled = True
cboISDNLinesTyp e.Enabled = True
cboISDNLinesCar rier.Enabled = True
cboISDNLinesSit e.Enabled = True
dtpISDNLinesIns tallationDate.E nabled = True
End Sub
'ISDN Lines Code Finish

'BT Lines Code Start
Private Sub btnBTLinesDelet e_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesDelet e.Click
If (Me.BindingCont ext(dsBTLines, "BTLines").Coun t > 0) Then
Me.BindingConte xt(dsBTLines,
"BTLines").Remo veAt(Me.Binding Context(dsBTLin es, "BTLines").Posi tion)
End If
End Sub

Private Sub btnBTLinesAdd_C lick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnBTLinesAdd.C lick
txtBTLinesID.En abled = True
txtBTLinesNumbe r.Enabled = True
txtBTLinesAccou ntNumber.Enable d = True
txtBTLinesNotes .Enabled = True
txtBTLinesDP.En abled = True
txtBTLinesPair. Enabled = True
txtBTLinesExcha nge.Enabled = True
cboBTLinesPrima ryUser.Enabled = True
cboBTLinesType. Enabled = True
cboBTLinesSite. Enabled = True
dtpBTLinesInsta llationDate.Ena bled = True
Try
Me.BindingConte xt(dsBTLines, "BTLines").EndC urrentEdit()
Me.BindingConte xt(dsBTLines, "BTLines").AddN ew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub

Private Sub btnBTLinesCance l_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesCance l.Click
Me.BindingConte xt(dsBTLines, "BTLines").Canc elCurrentEdit()
txtBTLinesID.En abled = False
txtBTLinesNumbe r.Enabled = False
txtBTLinesAccou ntNumber.Enable d = False
txtBTLinesNotes .Enabled = False
txtBTLinesDP.En abled = False
txtBTLinesPair. Enabled = False
txtBTLinesExcha nge.Enabled = False
cboBTLinesPrima ryUser.Enabled = False
cboBTLinesType. Enabled = False
cboBTLinesSite. Enabled = False
dtpBTLinesInsta llationDate.Ena bled = False
End Sub

Private Sub btnBTLinesUpdat e_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesUpdat e.Click
Try
Dim objDataSetChang es As Excellence.NET. dsBTLines = New
Excellence.NET. dsBTLines()
Me.BindingConte xt(dsBTLines, "BTLines").EndC urrentEdit()
objDataSetChang es = CType(dsBTLines .GetChanges,
Excellence.NET. dsBTLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsBTLines) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaSites.Fil l(dsBTLines)
Me.odaPrimaryUs er.Fill(dsBTLin es)
Me.odaCommsType .Fill(dsBTLines )
Me.odaBTLines.F ill(dsBTLines)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsBTLines.Merge (objDataSetChan ges)
dsBTLines.Accep tChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtBTLinesID.En abled = False
txtBTLinesNumbe r.Enabled = False
txtBTLinesAccou ntNumber.Enable d = False
txtBTLinesNotes .Enabled = False
txtBTLinesDP.En abled = False
txtBTLinesPair. Enabled = False
txtBTLinesExcha nge.Enabled = False
cboBTLinesPrima ryUser.Enabled = False
cboBTLinesType. Enabled = False
cboBTLinesSite. Enabled = False
dtpBTLinesInsta llationDate.Ena bled = True
End Sub

Private Sub btnBTLinesEdit_ Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnBTLinesEdit. Click
txtBTLinesID.En abled = True
txtBTLinesNumbe r.Enabled = True
txtBTLinesAccou ntNumber.Enable d = True
txtBTLinesNotes .Enabled = True
txtBTLinesDP.En abled = True
txtBTLinesPair. Enabled = True
txtBTLinesExcha nge.Enabled = True
cboBTLinesPrima ryUser.Enabled = True
cboBTLinesType. Enabled = True
cboBTLinesSite. Enabled = True
dtpBTLinesInsta llationDate.Ena bled = True
End Sub
'BT Lines Code Finish

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ec******** ******@TK2MSFTN GP10.phx.gbl...
Hi Mad,

This is not knowing, this is guessing.

Can you do a BindingContext( ds.Tables"yourt able").EndCurre ntEdit() before
that row.

Maybe did you create a new row with the BindingContext and is it not yet in your table.

Just a gues do not shoot when it is wrong

Cor

Nov 20 '05 #4
Hi Mad,

I have seen what I think that gives the error, however I have also seen
things in this code what is in my opinion wrong. However not more tonight,
when I do not see that everything is resolved I do it tomorrow.

And when it is keep watching this thread because I have seen an error which
is in my opinion more made, I will try to check it tomorrow.

Cor
Nov 20 '05 #5
Hi Mad,

I have looked at your code, it is to much to do everything and I do not have
the database and the controls, creating that is real to much work.

However I did look deep to it, there are errors in it however I cannot see
how that reflects to your errors.

First advice set on Option Strict

I saw in the first 3 rows something that should give an error. See what I
changed (not only syntatical, you use the wrong name for the currencymanager
in my opinion in your program)
\\\
Dim cmDScentrexLine s As CurrencyManager
Dim cmDSMobiles As CurrencyManager
Private Sub frmMainMenuPass words_Load(ByVa l _
sender As System.Object, ByVal e As System.EventArg s) Handles
MyBase.Load
cmDScentrexLine s = DirectCast(Bind ingContext(dsCe ntrexLines, _
"Centrexlines") , CurrencyManager )
cmDSMobiles = DirectCast(Bind ingContext(dsMo biles, _
"MobilePhones") , CurrencyManager )
////
Then it is easier for debugging when you have an error to break up commands,
when it is working you can alway set it back to some more compact code.

I tried it to change as far as I could understand what you did want to do,
and as I said, I could not test anything.

\\\\
Private Sub cboCentrexlines Type_SelectedIn dexChanged(ByVa l sender As
Object, _
ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If cmDScentrexLine s.Position <> -1 And _
Not mlLoading Then
Dim i As Integer = cmDScentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(i).Item("Com msTypeID") = _
Me.cboCentrexLi nesType.Selecte dValue()
End If
End Sub
///

Then I have seen you use the "remove", what it does is deleting rows from a
datarow, however does not update that remove in the dataset, for that you
have to use the "delete" (there is no rowstate "remove").

It is mostly difficult to find that delete if you do not know it, when you
know it is again easy, here a link with some samples, but that is not the
only method.

http://support.microsoft.com/default...b;en-us;301248

///

What I am curious for is what is the value from that *i* when the error is
thrown.

I hope this helps so far?

Cor
Nov 20 '05 #6
Cor,

Many thanks for your reply, i`ll have a look and start changing my code
around. I`ll post here in a while and let you know what happens

Many thanks
MCN

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mad,

I have looked at your code, it is to much to do everything and I do not have the database and the controls, creating that is real to much work.

However I did look deep to it, there are errors in it however I cannot see
how that reflects to your errors.

First advice set on Option Strict

I saw in the first 3 rows something that should give an error. See what I
changed (not only syntatical, you use the wrong name for the currencymanager in my opinion in your program)
\\\
Dim cmDScentrexLine s As CurrencyManager
Dim cmDSMobiles As CurrencyManager
Private Sub frmMainMenuPass words_Load(ByVa l _
sender As System.Object, ByVal e As System.EventArg s) Handles
MyBase.Load
cmDScentrexLine s = DirectCast(Bind ingContext(dsCe ntrexLines, _
"Centrexlines") , CurrencyManager )
cmDSMobiles = DirectCast(Bind ingContext(dsMo biles, _
"MobilePhones") , CurrencyManager )
////
Then it is easier for debugging when you have an error to break up commands, when it is working you can alway set it back to some more compact code.

I tried it to change as far as I could understand what you did want to do,
and as I said, I could not test anything.

\\\\
Private Sub cboCentrexlines Type_SelectedIn dexChanged(ByVa l sender As
Object, _
ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If cmDScentrexLine s.Position <> -1 And _
Not mlLoading Then
Dim i As Integer = cmDScentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(i).Item("Com msTypeID") = _
Me.cboCentrexLi nesType.Selecte dValue()
End If
End Sub
///

Then I have seen you use the "remove", what it does is deleting rows from a datarow, however does not update that remove in the dataset, for that you
have to use the "delete" (there is no rowstate "remove").

It is mostly difficult to find that delete if you do not know it, when you
know it is again easy, here a link with some samples, but that is not the
only method.

http://support.microsoft.com/default...b;en-us;301248

///

What I am curious for is what is the value from that *i* when the error is
thrown.

I hope this helps so far?

Cor

Nov 20 '05 #7
Cor,

I`ve made the following changes to my programs, as below. I`ve also cut out
a lot to make it simple and only one form.

When i run it and try and select a option from my combo box it just fails
again say "No Position at Row 1" and errors on this line:

dsCentrexLines. CentrexLines.Ro ws(I).Item("Use rsID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue (or the corosponding line from
the Position_Change d for that Combo Box)

Cor, one thing does it matter the order of the Postion_Changed items, like
it does when you fill the Datasets?

Many Thanks Again
MCN

Cor - Here is my new code

Private Sub frmMainMenuPhon es_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
cmDsCentrexLine s = DirectCast(Bind ingContext(dsCe ntrexLines,
"Centrexlines") , CurrencyManager )
mlLoading = True
'Start of Fill Datasets
Try
dsCentrexLines. EnforceConstrai nts = False
Try
Me.odcPhones.Op en()
'Fill CentrexLines Copier Datasets
Me.odaCommsType .Fill(dsCentrex Lines)
Me.odaSites.Fil l(dsCentrexLine s)
Me.odaDepartmen ts.Fill(dsCentr exLines)
Me.odaPrimaryUs er.Fill(dsCentr exLines)
Me.odaCentrexLi nes.Fill(dsCent rexLines)
Catch fillException As System.Exceptio n
Throw fillException
Finally
'To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
'dsCentrexLines .EnforceConstra ints = True
Me.odcPhones.Cl ose()
End Try
Catch eLoad As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eLoad.Me ssage)
Finally
mlLoading = False
End Try
'End of Fill Datasets
End Sub

'Start of Position Changed Code - Centrexlines
Private Sub cmdsCentrexLine s_PositionChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cmDsCentrexLine s.PositionChang ed
dsCentrexLines_ PositionChanged ()
End Sub

Private Sub cboCentrexLines Type_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(I).Item("Com msTypeID") =
Me.cboCentrexLi nesType.Selecte dValue
End If
End Sub

Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(I).Item("Use rsID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub

Private Sub cboCentrexlines Department_Sele ctedIndexChange d(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(I).Item("Dep artmentID") =
Me.cboCentrexLi nesDepartment.S electedValue
End If
End Sub

Private Sub cboCentrexLines Site_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Site.SelectedIn dexChanged
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(I).Item("Sit esID") =
Me.cboCentrexLi nesSite.Selecte dValue
End If
End Sub

Private Sub dsCentrexLines_ PositionChanged ()
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
Then
Me.cboCentrexLi nesType.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("CommsTypeI D")
Me.cboCentrexLi nesPrimaryUser. SelectedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID")
Me.cboCentrexLi nesDepartment.S electedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("DepartmentID" )
Me.cboCentrexLi nesSite.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("SitesID")
End If
End Sub
'END of Position Changed Code - Centrexlines

"MadCrazyNewbie " <te**@nospam.co m> wrote in message
news:M5******** ************@ka roo.co.uk...
Cor,

Many thanks for your reply, i`ll have a look and start changing my code
around. I`ll post here in a while and let you know what happens

Many thanks
MCN

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mad,

I have looked at your code, it is to much to do everything and I do not have
the database and the controls, creating that is real to much work.

However I did look deep to it, there are errors in it however I cannot see how that reflects to your errors.

First advice set on Option Strict

I saw in the first 3 rows something that should give an error. See what I changed (not only syntatical, you use the wrong name for the

currencymanager
in my opinion in your program)
\\\
Dim cmDScentrexLine s As CurrencyManager
Dim cmDSMobiles As CurrencyManager
Private Sub frmMainMenuPass words_Load(ByVa l _
sender As System.Object, ByVal e As System.EventArg s) Handles
MyBase.Load
cmDScentrexLine s = DirectCast(Bind ingContext(dsCe ntrexLines, _
"Centrexlines") , CurrencyManager )
cmDSMobiles = DirectCast(Bind ingContext(dsMo biles, _
"MobilePhones") , CurrencyManager )
////
Then it is easier for debugging when you have an error to break up

commands,
when it is working you can alway set it back to some more compact code.

I tried it to change as far as I could understand what you did want to do, and as I said, I could not test anything.

\\\\
Private Sub cboCentrexlines Type_SelectedIn dexChanged(ByVa l sender As
Object, _
ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If cmDScentrexLine s.Position <> -1 And _
Not mlLoading Then
Dim i As Integer = cmDScentrexLine s.Position
dsCentrexLines. CentrexLines.Ro ws(i).Item("Com msTypeID") = _
Me.cboCentrexLi nesType.Selecte dValue()
End If
End Sub
///

Then I have seen you use the "remove", what it does is deleting rows from a
datarow, however does not update that remove in the dataset, for that

you have to use the "delete" (there is no rowstate "remove").

It is mostly difficult to find that delete if you do not know it, when you know it is again easy, here a link with some samples, but that is not the only method.

http://support.microsoft.com/default...b;en-us;301248

///

What I am curious for is what is the value from that *i* when the error is thrown.

I hope this helps so far?

Cor


Nov 20 '05 #8
Hi Mad,

You know I am myself also fighting with the combobox however that is the
textbox part.

Can you try this and tell what it is?

\\\
Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position Dim y as integer = dsCentrexLines. CentrexLines.Ro ws.count

messagebox.show (I.tostring & " " & Y.tostring)

Position is a zero index so the count should always be one more than the
position.
dsCentrexLines. CentrexLines.Ro ws(I).Item("Use rsID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub


Nov 20 '05 #9
Hey cor,

Using the following Code:-

Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position
Dim y As Integer = dsCentrexLines. CentrexLines.Ro ws.Count
MessageBox.Show (I.ToString & " " & y.ToString)
dsCentrexLines. CentrexLines.Ro ws(I).Item("Use rsID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub

When i first run my App it pops up and tells me 0 1, when i select something
from my ComboBox it tells me 1 1 , then fails again on the same code:(

Many Thanks
MCN

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OM******** ******@TK2MSFTN GP11.phx.gbl...
Hi Mad,

You know I am myself also fighting with the combobox however that is the
textbox part.

Can you try this and tell what it is?

\\\
> Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal

sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If cmDsCentrexLine s.Position <> -1 And Not mlLoading Then
Dim I As Integer = cmDsCentrexLine s.Position

Dim y as integer = dsCentrexLines. CentrexLines.Ro ws.count

messagebox.show (I.tostring & " " & Y.tostring)

Position is a zero index so the count should always be one more than the
position.
dsCentrexLines. CentrexLines.Ro ws(I).Item("Use rsID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub


Nov 20 '05 #10

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

Similar topics

3
11770
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
10
19366
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is able to fill that one out just fine. The second form is multipart/form-data. Unfortunately, I haven't been able to fill that out in a way that makes the server happy. I set up a copy of this form at my web site so that I could see exactly what a...
1
9207
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
4
25569
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me what's wrong regards I get this error:
1
6901
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by itself (asp.net recycled?); it also can be solved by restarting IIS. Any ideas what cause(s) this to happen? System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr) at...
3
8843
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application. ---------------------------------------------------------------------------- ----
5
9657
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve this error? Oracle error occurred, but error message could not be retrieved from Oracle. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the...
18
2761
by: Joel Hedlund | last post by:
Hi! The question of type checking/enforcing has bothered me for a while, and since this newsgroup has a wealth of competence subscribed to it, I figured this would be a great way of learning from the experts. I feel there's a tradeoff between clear, easily readdable and extensible code on one side, and safe code providing early errors and useful tracebacks on the other. I want both! How do you guys do it? What's the pythonic way? Are...
18
22413
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? -robert PS: numpy.corrcoef computes only the bare coeff:
4
4157
by: Rick | last post by:
I've moved code from a stage machine to the production machine, exact same code works fine on the stage machine, they are both windows 2003 servers, I'm getting a "Cannot generate SSPI context" error, there are other sites on this server that access the same database. IIS is the same, permissions to the database are correct. Any suggestions? Error:
0
9721
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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
10373
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5547
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.