我想将会话添加到datatable [英] I want to add session to datatable

查看:74
本文介绍了我想将会话添加到datatable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个列表视图,我在第一列添加了一个按钮。当我点击按钮时,将打开其他页面。在此页面中,将在发送会话后添加信息。

但是当我点击按钮,会话将发送选定的行。

我的代码:



dt.Rows [..] [Column] =会话[A ] .ToString();



我不知道(...)会写什么





我该怎么办?谢谢

解决方案

......应该替换为你想要改变的行的索引。第一行的索引为0.请记住,需要创建数据表,并且必须已存在具有指定索引的行。否则你会遇到异常。



欲了解更多信息,请参阅 DataRowCollection.Item Property(Int32)(System.Data) [ ^ ]



如果该行尚不存在,则应使用 NewRow 方法创建一行,参见DataTable.NewRow Method(System.Data) [ ^ ]

Hi, there is a listview and I added a button in first column.When I click button, will open other page.In this page, will add information after send session.
But when I click button,session will send selected row.
My kod:

dt.Rows[..][Column] = Session[A].ToString();

I dont know (...)what will be written


What can I do?Thank you

解决方案

The ... should be replaced with the index of the row you want to change. The index for the first row is 0. Bear in mind that the datatable needs to be created and a row with the specified index must already exist. Otherwise you will encounter an exception.

For more information, please see DataRowCollection.Item Property (Int32) (System.Data)[^]

If the row does not yet exist, you should use the NewRow method to create one, see DataTable.NewRow Method (System.Data)[^]


这篇关于我想将会话添加到datatable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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