本文介绍了代码与数据库之间的交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从数据库中获得一个数据表,然后将该数据表绑定到一个DataGridView.用户在DataGridView上编辑信息后,如何进行这些更改并将其放回到DB中? DataGrid的列是.........谢谢.
< datagrid.columns>
< datagridtextcolumn标头="{loc:Translateالموظف}" loc:translate.uid ="1268" width ="*" isreadonly ="True" binding ="{Binding Path = Name}" xmlns:loc =#unknown" >
< datagridtextcolumn标头="{loc:Translateالوردية}" loc:translate.uid ="1269" width ="*" isreadonly ="True" binding ="{Binding Path = shift_name}" xmlns:loc =#unknown" >
< datagridtextcolumn标头="{loc:Translateعددساعاتالتأخير}" loc:translate.uid ="1269" width ="auto" isreadonly ="False" binding ="{Binding Path = Name_latin}" xmlns:loc =#未知">
< datagridcheckboxcolumn标头="{loc:Translateحضور}" loc:translate.uid ="1270" width ="auto" isreadonly ="False" binding ="{Binding Path = Name_latin}" xmlns:loc =#unknown" >

I get a DataTable from DB and then bind that DataTable to a DataGridView. Once the user edits the information on the DataGridView how do I take those changes and put them back into DB ? the DataGrid ''s Columns are......... thanks.
<datagrid.columns>
<datagridtextcolumn header="{loc:Translate الموظف}" loc:translate.uid="1268" width="*" isreadonly="True" binding="{Binding Path=Name}" xmlns:loc="#unknown">
<datagridtextcolumn header="{loc:Translate الوردية }" loc:translate.uid="1269" width="*" isreadonly="True" binding="{Binding Path=shift_name}" xmlns:loc="#unknown">
<datagridtextcolumn header="{loc:Translate عدد ساعات التأخير }" loc:translate.uid="1269" width="auto" isreadonly="False" binding="{Binding Path=Name_latin}" xmlns:loc="#unknown">
<datagridcheckboxcolumn header="{loc:Translate حضور}" loc:translate.uid="1270" width="auto" isreadonly="False" binding="{Binding Path=Name_latin}" xmlns:loc="#unknown">

推荐答案


这篇关于代码与数据库之间的交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 11:02