如何检索数据行值并将其存储到变量中 [英] how to retrieve the datarow values and store it into the variables

查看:78
本文介绍了如何检索数据行值并将其存储到变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检索数据行值并将其存储到变量中。



我的代码如下;



how to retrieve the datarow values and store it into the variables.

My code as follows;

DataRow objRow;
           objRow = objDt.NewRow();

           objRow[0] = sCourse;
           objRow[1] = sRate;
           objRow[2] = ViewState["batchid"].ToString();
           if (ViewState["temp"] == "P")
           {
               objRow[3] = ViewState["PackageID"];
           }
           else
           {
               objRow[3] = "";
               objRow[4] = Convert.ToDateTime(ViewState["StDt"].ToString());
               objRow[5] = Convert.ToDateTime(ViewState["EdDt"].ToString());
           }







从我上面的代码中获取objRow [ 4]和objRow [5]将值存储到变量中。



请帮助我。我怎么能用csharp。



问候,

Narasiman P.




From my above code how to get the objRow[4] and objRow[5] values and store it into the variables.

Please help me. how can i do using csharp.

Regards,
Narasiman P.

推荐答案

Quote:

从我上面的代码中获取objRow [4]和objRow [5]值并将其存储到变量中。

From my above code how to get the objRow[4] and objRow[5] values and store it into the variables.



这是一个非常奇怪的要求,因为你的代码创建了这样的值。

你不能只为变量分配相同的值您曾经分配给 objRow [4] objRow [5]


That is a really strange requirement, since your code created such values.
Cannot you just assign to the variables the same values you''ve used to assign to objRow[4] and objRow[5]?


这篇关于如何检索数据行值并将其存储到变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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