DataRow - 如何? [英] DataRow - How To?

查看:67
本文介绍了DataRow - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿小组,


我想知道是否有人能帮助我?我遇到麻烦

使用DataViews和DataRows :(


我只是不明白,所以我想知道是否有人会如此善良

修改下面的代码以包含Datarows和Dataviews,也许还可以解释

a还有什么?


非常感谢

问候

MCN

代码开始<<<<




Private Sub frmMainMenuPasswords_Load(ByVal sender As System.Object,ByVal e

As System.EventArgs)处理MyBase .Load


cmDsPasswordList = BindingContext(dsPasswordList," PasswordList")

mlLoading = True

''开始填充数据集

尝试

dsPasswordList.EnforceConstraints = False

dsArcirisUsers.EnforceConstraints = False

尝试

Me.odcPasswordLists.Open()

'填写密码列表数据集

Me.odaDepartments.Fill(dsPasswordList)

Me.odaPasswordList.Fill(dsPasswordList)

Catch fillException As System.Exception

抛出fillException

最后

''如果数据集绑定失败则启用 - 启用将

导致BIG数据集

''dsPasswordList.EnforceConstraints = True

Me.odcPasswordLists.Close()

结束尝试

Catch eLoad As System.Exception

System.Windows.Forms.MessageBox.Show(eLoad.Message)

最后

mlLoading = False

结束尝试

''填充数据集结束

结束子


''开始更改位置代码 - 密码列表

Private Sub cmDsPasswordList_PositionChanged(ByVal sender As Object,

ByVal e As System.EventArgs)处理cmDsPasswordList.PositionChanged

DsPasswordList_PositionChanged()< br $>
End Sub


Pri vate Sub cboPasswordListsDepartment_SelectedIndexChanged(由Val发送者

As Object,ByVal e As System.EventArgs)句柄

cboPasswordListsDepartment.SelectedIndexChanged

Me.BindingContext(dsPasswordList ,密码列表。)。EndCurrentEdit()

如果是Me.BindingContext(dsPasswordList," PasswordList")。Position<> -1

而不是mlLoading然后


dsPasswordList.PasswordList.Rows(Me.BindingContext(dsPasswordList,

" PasswordList" ).Position).Item(" DepartmentID")=

Me.cboPasswordListsDepartment.SelectedValue

结束如果

结束子


Private Sub DsPasswordList_PositionChanged()

Me.BindingContext(dsPasswordList," PasswordList")。EndCurrentEdit()

如果是Me.BindingContext(dsPasswordList) ,密码列表)。位置<> -1

而不是mlLoading然后

Me.cboPasswordListsDepartment.SelectedValue =

dsPasswordList.PasswordList.Rows(Me.BindingContext(dsPasswordList,
" PasswordList")。Position).Item(" DepartmentID")

结束如果

结束子

''结束位置更改代码 - 密码列表


''PasswordLists代码开始

Private Sub btnPasswordListsDelete_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs)处理btnPasswordListsDelete.Click

如果MessageBox.Show(你确定要删除吗?,

" ;警告!!!!",MessageBoxButtons.OKCancel)= DialogResult.OK然后

If(Me.BindingContext(dsPasswordList," PasswordList")。Count> 0)

然后

Me.BindingContext(dsPasswordList,

" PasswordList")。RemoveAt(Me.BindingContext(dsPassw ordList,

" ; PasswordList"。)POSITI on)

结束如果

结束如果

结束子


私人子btnPasswordListsAdd_Click(ByVal发件人)作为System.Object,

ByVal e As System.EventArgs)处理btnPasswordListsAdd.Click

''重置组合框 - 由于M $ Bug选择索引两次

cboPasswordListsDepartment.Text =""

cboPasswordListsDepartment.SelectedIndex = -1

cboPasswordListsDepartment.SelectedIndex = -1

尝试

Me.BindingContext(dsPasswordList,

" PasswordList")。EndCurrentEdit()

Me.BindingContext(dsPasswordList," PasswordList" ).AddNew()

Catch eEndEdit As System.Exception

System.Windows.Forms.MessageBox.Show(eEndEdit.Mess age)

结束尝试

End Sub


Private Sub btnPasswordListsCancel_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs)处理btnPasswordListsCancel.Click

Me.BindingCont ext(dsPasswordList,

" PasswordList")。CancelCurrentEdit()

End Sub


Private Sub btnPasswordListsUpdate_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs)处理btnPasswordListsUpdate.Click

如果MessageBox.Show(你确定要保存更改吗?,

"警告!!!!",MessageBoxButtons.OKCancel)= DialogResult.OK然后

尝试

Dim objDataSetChanges As Excellence.NET .dsPasswordList = New

Excellence.NET.dsPasswordList()

Me.BindingContext(dsPasswordList,

" PasswordList")。EndCurrentEdit()

objDataSetChanges = CType(dsPasswordList.GetChanges,

Excellence.NET.dsPasswordList)

If(Not(objDataSetChanges)Is Nothing)然后

尝试

如果(不(dsPasswordList)什么都没有)那么

Me.odcPasswordLists.Open()

odaDepartments。更新(dsPasswordList)

odaPasswor dList.Update(dsPasswordList)

结束如果

Catch updateException As System.Exception

抛出updateException

最后

Me.odcPasswordLists.Close()

结束尝试

结束如果

dsPasswordList.Merge(objDataSetChanges)

dsPasswordList.AcceptChanges()

Catch eUpdate As System.Exception

System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)

结束尝试

结束如果

结束子

解决方案

Bug

cboPasswordListsDepartment.Text =""

cboPasswordListsDepartment.SelectedIndex = -1

cboPasswordListsDepartment.SelectedIndex = -1

尝试

Me.BindingContext(dsPasswordList,

" PasswordList")。EndCurrentEdit()

Me.BindingContext(dsPasswordList," PasswordList")。AddNew()

Catch eEndEdit As System.Exception

System.Windows.Forms.Messag eBox.Show(eEndEdit.Mess年龄)

结束尝试

结束子


Private Sub btnPasswordListsCancel_Click(ByVal sender As System。对象,

ByVal e As System.EventArgs)处理btnPasswordListsCancel.Click

Me.BindingContext(dsPasswordList,

" PasswordList")。CancelCurrentEdit ()

End Sub


Private Sub btnPasswordListsUpdate_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs)处理btnPasswordListsUpdate.Click

如果MessageBox.Show(你确定要保存更改吗?,

"警告!!!!",MessageBoxButtons .OKCancel)= DialogResult.OK然后

尝试

Dim objDataSetChanges As Excellence.NET.dsPasswordList = New

Excellence.NET.dsPasswordList()

Me.BindingContext(dsPasswordList,

" PasswordList")。EndCurrentEdit()

objDataSetChanges = CType(dsPasswordList.GetChanges,
Exc ellence.NET.dsPasswordList)

如果(不(objDataSetChanges)什么都没有)那么

尝试

如果(不(dsPasswordList)什么都没有)然后

Me.odcPasswordLists.Open()

odaDepartments.Update(dsPasswordList)

odaPasswordList.Update(dsPasswordList)

结束如果

Catch updateException As System.Exception

抛出updateException

最后

Me.odcPasswordLists.Close ()

结束尝试

结束如果

dsPasswordList.Merge(objDataSetChanges)

dsPasswordList.AcceptChanges()

Catch eUpdate As System.Exception

System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)

结束尝试

结束如果

结束子


下面有大量代码。我建议你更简洁,

你有问题。你不了解DataRow和DataView。?

Rows是一个表中的DataRows集合,一个表DataView是一个视图

那个表,那里也是一个独立的DataView类。


你现在可以再试一次吗?


-


OHM(特里伯恩斯)

。 。 。单手人。 。

如果你需要我的电子邮件,请问我


当你不知道自己在做什么时,过得很快


" MadCrazyNewbie" < TE ** @ nospam.com>在消息中写道

新闻:SB ******************** @ karoo.co.uk ...

嘿小组,

我想知道是否会有人帮助我?我在使用DataViews和DataRows时遇到了麻烦:(

我只是不明白,所以我想知道是否有人会这么善良
应该在下面修改我的代码以包含Datarows和数据视图,也许
解释一下?

非常感谢
问候
MCN

> CODE START<<<<<


Private Sub frmMainMenuPasswords_Load(ByVal sender As System.Object,ByVal


$ b $ as As System。处理MyBase.Load

cmDsPasswordList = BindingContext(dsPasswordList," PasswordList")
mlLoading = True
''开始填充数据集
尝试
dsPasswordList.EnforceConstraints = False
dsArcirisUsers.EnforceConstraints = False
尝试
Me.odcPasswordLists.Open()
''填写密码列表数据集
Me.odaDepartments.Fill(dsPasswordList)
Me.odaPasswordList.Fill(dsPasswordList)
Catch fillException As System.Exception
抛出fillException
最后
''要启用如果数据集绑定失败 - 启用将导致大数据集
''dsPasswordList.EnforceConstraints = True
Me.odcPasswordLists.Close()
结束尝试
捕获eLoad作为系统.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message)
最后
mlLoading = False
结束尝试
''填充数据集结束
结束子

''开始更改位置代码 - 密码列表
私有子cmDsPasswordList_PositionChanged(ByVal发送者为对象,
ByVal e As System.EventArgs)处理cmDsPasswordList.PositionChanged
DsPassword List_PositionChanged()
End Sub

私人子cboPasswordListsDepartment_SelectedIndexChanged(由Val
发件人作为对象,ByVal e As System.EventArgs)处理
cboPasswordListsDepartment.SelectedIndexChanged
Me.BindingContext(dsPasswordList," PasswordList")。EndCurrentEdit()
如果是Me.BindingContext(dsPasswordList," PasswordList")。Position
<> -1而不是mlLoading然后

dsPasswordList.PasswordList.Rows(Me.BindingContext(dsPasswordList,
" PasswordList))。Position).Item(" DepartmentID")=
Me.cboPasswordListsDepartment.SelectedValue
结束如果
结束Sub
私有子DsPasswordList_PositionChanged()
Me.BindingContext(dsPasswordList," PasswordList")。EndCurrentEdit()
如果Me.BindingContext(dsPasswordList," PasswordList")。Position
<> -1而不是mlLoading然后
Me.cboPasswordListsDepartment.SelectedValue =
dsPasswordList.PasswordList.Rows(Me.BindingContext(dsPasswordList,
" PasswordList))。Position).Item(" DepartmentID" ;)
结束如果
结束子
''结束位置更改代码 - 密码列表

''密码列表代码开始
私有子btnPasswordListsDelete_Click(ByVal sender as
System.Object,ByVal e As System.EventArgs)处理btnPasswordListsDelete.Click
如果MessageBox.Show(你确定要删除吗?,
"警告!!!!",MessageBoxButtons.OKCancel)= DialogResult.OK然后
If(Me.BindingContext(dsPasswordList," PasswordList")。Count>
0)然后
我。 BindingContext(dsPasswordList,
" PasswordList")。RemoveAt(Me.BindingContext(dsPassw ordList,
" PasswordList"。)。Position)
结束如果
结束如果


私有子btnPasswordListsAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs)处理btnPasswordListsAdd.Click
''重置组合框 - 选择索引两次由于M


错误
cboPasswordListsDepartment.Text =""
cboPasswordListsDepartment.SelectedIndex = -1
cboPasswordListsDepartment.SelectedIndex = -1
尝试
Me.BindingContext(dsPasswordList,
" PasswordList")。EndCurrentEdit()
Me.BindingContext(dsPasswordList," PasswordList")。AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Mess age)
结束尝试
End Sub

私有子btnPasswordListsCancel_Click(ByVal发送者为
System.Object,ByVal e As System.EventArgs)处理btnPasswordListsC ancel.Click
Me.BindingContext(dsPasswordList,
" PasswordList")。CancelCurrentEdit()
End Sub

Private Sub btnPasswordListsUpdate_Click(ByVal sender As
System.Object,ByVal e As System.EventArgs)处理btnPasswordListsUpdate.Click
如果MessageBox.Show(你确定要保存更改吗?,
警告!!!! ",MessageBoxButtons.OKCancel)= DialogResult.OK然后
尝试
Dim objDataSetChanges As Excellence.NET.dsPasswordList =
新的Excellence.NET.dsPasswordList()
Me.BindingContext( dsPasswordList,
" PasswordList"。)EndCurrentEdit()
objDataSetChanges = CType(dsPasswordList.GetChanges,
Excellence.NET.dsPasswordList)
If(Not(objDataSetChanges)Is Nothing)然后尝试
如果(不(dsPasswordList)什么都没有)那么
Me.odcPasswordLists.Open()
odaDepartments.Update(dsPasswordList)
odaPasswordList.Update(dsPasswordList)
结束如果
Catch updateException As System.Exception
抛出updateException
最后
Me.odcPasswordLists.Close()
结束尝试
结束如果
dsPasswordList.Merge(objDataSetChanges)
dsPasswordList.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)
结束尝试
结束如果
结束子


Hey Group,

I wondered if somebody would be so kind as to help me? Im having trouble
with DataViews and DataRows:(

I just don`t understand, so I wondered if somebody would be so kind enought
to modify my code below to include Datarows and Dataviews and maybe explain
a little aswell?

Many Thanks
Regards
MCN

CODE START <<<<



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

cmDsPasswordList = BindingContext(dsPasswordList, "PasswordList")
mlLoading = True
''Start of Fill Datasets
Try
dsPasswordList.EnforceConstraints = False
dsArcirisUsers.EnforceConstraints = False
Try
Me.odcPasswordLists.Open()
''Fill Password Lists Datasets
Me.odaDepartments.Fill(dsPasswordList)
Me.odaPasswordList.Fill(dsPasswordList)
Catch fillException As System.Exception
Throw fillException
Finally
''To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
''dsPasswordList.EnforceConstraints = True
Me.odcPasswordLists.Close()
End Try
Catch eLoad As System.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message )
Finally
mlLoading = False
End Try
''End of Fill Datasets
End Sub

''Start of Position Changed Code - Password Lists
Private Sub cmDsPasswordList_PositionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmDsPasswordList.PositionChanged
DsPasswordList_PositionChanged()
End Sub

Private Sub cboPasswordListsDepartment_SelectedIndexChanged(By Val sender
As Object, ByVal e As System.EventArgs) Handles
cboPasswordListsDepartment.SelectedIndexChanged
Me.BindingContext(dsPasswordList, "PasswordList").EndCurrentEdit()
If Me.BindingContext(dsPasswordList, "PasswordList").Position <> -1
And Not mlLoading Then

dsPasswordList.PasswordList.Rows(Me.BindingContext (dsPasswordList,
"PasswordList").Position).Item("DepartmentID") =
Me.cboPasswordListsDepartment.SelectedValue
End If
End Sub

Private Sub DsPasswordList_PositionChanged()
Me.BindingContext(dsPasswordList, "PasswordList").EndCurrentEdit()
If Me.BindingContext(dsPasswordList, "PasswordList").Position <> -1
And Not mlLoading Then
Me.cboPasswordListsDepartment.SelectedValue =
dsPasswordList.PasswordList.Rows(Me.BindingContext (dsPasswordList,
"PasswordList").Position).Item("DepartmentID")
End If
End Sub
''End of Position Changed Code - Password Lists

''PasswordLists Code Start
Private Sub btnPasswordListsDelete_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsDelete.Click
If MessageBox.Show("Are Your Sure You Want To Delete?",
"WARNING!!!!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
If (Me.BindingContext(dsPasswordList, "PasswordList").Count > 0)
Then
Me.BindingContext(dsPasswordList,
"PasswordList").RemoveAt(Me.BindingContext(dsPassw ordList,
"PasswordList").Position)
End If
End If
End Sub

Private Sub btnPasswordListsAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsAdd.Click
''Reset Combo Box`s - Select Index Twice due to M$ Bug
cboPasswordListsDepartment.Text = ""
cboPasswordListsDepartment.SelectedIndex = -1
cboPasswordListsDepartment.SelectedIndex = -1
Try
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
Me.BindingContext(dsPasswordList, "PasswordList").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Mess age)
End Try
End Sub

Private Sub btnPasswordListsCancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsCancel.Click
Me.BindingContext(dsPasswordList,
"PasswordList").CancelCurrentEdit()
End Sub

Private Sub btnPasswordListsUpdate_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsUpdate.Click
If MessageBox.Show("Are Your Sure You Want To Save Changes?",
"WARNING!!!!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
Try
Dim objDataSetChanges As Excellence.NET.dsPasswordList = New
Excellence.NET.dsPasswordList()
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
objDataSetChanges = CType(dsPasswordList.GetChanges,
Excellence.NET.dsPasswordList)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsPasswordList) Is Nothing) Then
Me.odcPasswordLists.Open()
odaDepartments.Update(dsPasswordList)
odaPasswordList.Update(dsPasswordList)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPasswordLists.Close()
End Try
End If
dsPasswordList.Merge(objDataSetChanges)
dsPasswordList.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)
End Try
End If
End Sub

解决方案

Bug
cboPasswordListsDepartment.Text = ""
cboPasswordListsDepartment.SelectedIndex = -1
cboPasswordListsDepartment.SelectedIndex = -1
Try
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
Me.BindingContext(dsPasswordList, "PasswordList").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Mess age)
End Try
End Sub

Private Sub btnPasswordListsCancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsCancel.Click
Me.BindingContext(dsPasswordList,
"PasswordList").CancelCurrentEdit()
End Sub

Private Sub btnPasswordListsUpdate_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsUpdate.Click
If MessageBox.Show("Are Your Sure You Want To Save Changes?",
"WARNING!!!!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
Try
Dim objDataSetChanges As Excellence.NET.dsPasswordList = New
Excellence.NET.dsPasswordList()
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
objDataSetChanges = CType(dsPasswordList.GetChanges,
Excellence.NET.dsPasswordList)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsPasswordList) Is Nothing) Then
Me.odcPasswordLists.Open()
odaDepartments.Update(dsPasswordList)
odaPasswordList.Update(dsPasswordList)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPasswordLists.Close()
End Try
End If
dsPasswordList.Merge(objDataSetChanges)
dsPasswordList.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)
End Try
End If
End Sub


There is a plethora of code beneath. I suggest you are more succinct with
you question. What dont you understand about DataRow and DataView.?

Rows isa collection of DataRows in a Table, A tables DataView is a view of
that Table, there is also a DataView class in its own right.

Can you try again now ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don''t know what you''re doing

"MadCrazyNewbie" <te**@nospam.com> wrote in message
news:SB********************@karoo.co.uk...

Hey Group,

I wondered if somebody would be so kind as to help me? Im having trouble
with DataViews and DataRows:(

I just don`t understand, so I wondered if somebody would be so kind enought to modify my code below to include Datarows and Dataviews and maybe explain a little aswell?

Many Thanks
Regards
MCN

> CODE START <<<<


Private Sub frmMainMenuPasswords_Load(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles MyBase.Load

cmDsPasswordList = BindingContext(dsPasswordList, "PasswordList")
mlLoading = True
''Start of Fill Datasets
Try
dsPasswordList.EnforceConstraints = False
dsArcirisUsers.EnforceConstraints = False
Try
Me.odcPasswordLists.Open()
''Fill Password Lists Datasets
Me.odaDepartments.Fill(dsPasswordList)
Me.odaPasswordList.Fill(dsPasswordList)
Catch fillException As System.Exception
Throw fillException
Finally
''To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
''dsPasswordList.EnforceConstraints = True
Me.odcPasswordLists.Close()
End Try
Catch eLoad As System.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message )
Finally
mlLoading = False
End Try
''End of Fill Datasets
End Sub

''Start of Position Changed Code - Password Lists
Private Sub cmDsPasswordList_PositionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmDsPasswordList.PositionChanged
DsPasswordList_PositionChanged()
End Sub

Private Sub cboPasswordListsDepartment_SelectedIndexChanged(By Val sender As Object, ByVal e As System.EventArgs) Handles
cboPasswordListsDepartment.SelectedIndexChanged
Me.BindingContext(dsPasswordList, "PasswordList").EndCurrentEdit()
If Me.BindingContext(dsPasswordList, "PasswordList").Position <> -1 And Not mlLoading Then

dsPasswordList.PasswordList.Rows(Me.BindingContext (dsPasswordList,
"PasswordList").Position).Item("DepartmentID") =
Me.cboPasswordListsDepartment.SelectedValue
End If
End Sub

Private Sub DsPasswordList_PositionChanged()
Me.BindingContext(dsPasswordList, "PasswordList").EndCurrentEdit()
If Me.BindingContext(dsPasswordList, "PasswordList").Position <> -1 And Not mlLoading Then
Me.cboPasswordListsDepartment.SelectedValue =
dsPasswordList.PasswordList.Rows(Me.BindingContext (dsPasswordList,
"PasswordList").Position).Item("DepartmentID")
End If
End Sub
''End of Position Changed Code - Password Lists

''PasswordLists Code Start
Private Sub btnPasswordListsDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPasswordListsDelete.Click
If MessageBox.Show("Are Your Sure You Want To Delete?",
"WARNING!!!!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
If (Me.BindingContext(dsPasswordList, "PasswordList").Count > 0) Then
Me.BindingContext(dsPasswordList,
"PasswordList").RemoveAt(Me.BindingContext(dsPassw ordList,
"PasswordList").Position)
End If
End If
End Sub

Private Sub btnPasswordListsAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnPasswordListsAdd.Click
''Reset Combo Box`s - Select Index Twice due to M


Bug
cboPasswordListsDepartment.Text = ""
cboPasswordListsDepartment.SelectedIndex = -1
cboPasswordListsDepartment.SelectedIndex = -1
Try
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
Me.BindingContext(dsPasswordList, "PasswordList").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Mess age)
End Try
End Sub

Private Sub btnPasswordListsCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPasswordListsCancel.Click
Me.BindingContext(dsPasswordList,
"PasswordList").CancelCurrentEdit()
End Sub

Private Sub btnPasswordListsUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPasswordListsUpdate.Click
If MessageBox.Show("Are Your Sure You Want To Save Changes?",
"WARNING!!!!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
Try
Dim objDataSetChanges As Excellence.NET.dsPasswordList = New Excellence.NET.dsPasswordList()
Me.BindingContext(dsPasswordList,
"PasswordList").EndCurrentEdit()
objDataSetChanges = CType(dsPasswordList.GetChanges,
Excellence.NET.dsPasswordList)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsPasswordList) Is Nothing) Then
Me.odcPasswordLists.Open()
odaDepartments.Update(dsPasswordList)
odaPasswordList.Update(dsPasswordList)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPasswordLists.Close()
End Try
End If
dsPasswordList.Merge(objDataSetChanges)
dsPasswordList.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Messa ge)
End Try
End If
End Sub



这篇关于DataRow - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆