问题标签 [datarowview]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
831 浏览

c# - 检查 datarowview.row.itemarray 中的不同值而不是空字符串

我通过以下代码获取datarowview

我如何在此处检查 s.Row.ItemArray 中的所有值是否不同。如果 value 为 null 或空字符串,它应该跳过不同的性质,即 ItemArray 中可以有多个 null 值或空字符串,但没有其他相同的值。

0 投票
4 回答
27295 浏览

c# - 如何在 c# 中将 DataRow 转换为 DataRowView

可以或如何将 DataRow 转换为 DataRowView?

例如:

0 投票
1 回答
501 浏览

wpf - wpf treeview 获取选定值

我有一个TreeView和一个ListBox。它们都是从不同DataTable的 s 填充的。

从以下Treeview位置获取数据:

父子关系:

所以我想从SelectedItemChanged上的 TreeView中获取id_product_type并将其传递给我的列表框,但是如何获取实际值 int?

0 投票
1 回答
2976 浏览

c# - 一种从 DataRowView 获取 DataRow 的方法

我目前正在尝试获取 DataGrid 中选定行的内容。

问题是我实际上得到了一个 DataRowView 但我不能用它做任何事情......

我想访问我的 DataGrid 中所选行的所有字段。

这是可以帮助您的代码:

XAML:

CS :

谢谢你的帮助

0 投票
1 回答
89 浏览

asp.net - 在 GridView 中查找列值

我想从中获取专栏(Description)DataRowView我有以下代码。

如何??????????用适当的代码替换?

0 投票
3 回答
1897 浏览

vb.net - 无法将“System.Int32”类型的对象转换为“System.Data.DataRowView”类型

我需要从所选项目的数据源中检索“id”,但它总是抛出标题中提到的相同错误。这是我的代码

0 投票
1 回答
58 浏览

sql-server - 如何通过 UI 在字段中设置值?

我在 Sqlserver Datavbase 表中使用三个字段,以防止用户永久删除记录:

我希望通过 UI 设置第三个字段(DeletedUserID),如下所示:

其他两个字段“IsDeleted”字段和“DeletedDate”在表的“删除触发器后”中自动设置。

然后使用以下代码成功地使用希望命令提交对数据库的更改:

但问题是,“DeletedUserID”在数据库中为空。

问题是:如何在 UI 中以真实方式设置“DeletedUserID”字段值?

0 投票
0 回答
97 浏览

.net - How to edit specific field value,only if another field value is changed?

I have WinForm aplication,.Net framework 4.5 with vs2012 and Sqlserver 2008 R2.

In my form i use "BindingSource_CurrentItemChanged" to add new value if row.IsNew (user insert a new row)

This worked successfully.

Then i want to write a method that when user edit a desire field value, my code put "UserID" to ModifiedUserID automatically (some thing like this):

I used below code in BindongSource_ListChanged but get error:

Error: DataTable Internal Index is corrupted: '5'.

after this if write a code in BindingSource_CurrentItemChanged

this code also raise a same exception too:

Error: DataTable Internal Index is corrupted: '5'.

Where do i put this code for change "ModifiedUserID" to this.UserID? in which event of BindingSource or DataGridView ?

0 投票
1 回答
315 浏览

wpf - 从列表视图中获取价值

这段代码中发生的情况是,当列表视图中的项目数为 3 时,drv 变量为空。谁能告诉我我做错了什么吗?

0 投票
2 回答
57 浏览

c# - .Net 中 dr["MyColumn"] 对象的类名/类型是什么?

我想创建函数并传递值以减少编码中的重复代码。

在 GridView ItemDataBound 事件中会这样调用

该功能将如下所示

但我不知道我应该在我的方法中放入什么来接受对象。