本文介绍了获取方法内的表行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 在方法中获取表格行值,而在foreach循环中 提前付款 Ajith 我尝试了什么: dDDate = x; duserdata = this .timeattDataSet.data; DataRow [] result = duserdata.Select( Date =# + dDDate + #); string cText_IO = '; foreach(结果中的DataRow行) { cText_IO = InOutReplace(DateTime dDDate) } 私有静态字符串InOutReplace(DateTime dDDateh) //现在我想得到当前表列值如果该值ok返回一些值 return 解决方案 这样的事情: foreach(结果中的DataRow行) { string cText_IO = InOutReplace(row,dDDate) Debug.Print(cText_IO); } 私有静态字符串InOutReplace(DataRow rowTemp,DateTime dDDateTemp) { if(rowTemp == null) { return string.Empty; } return rowTemp [Date]。ToString(); } Get table row value inside method ,while in foreach loopThanks in advance AjithWhat I have tried:dDDate = x; duserdata = this.timeattDataSet.data; DataRow[] result = duserdata.Select("Date = #" + dDDate + "#");string cText_IO="';foreach (DataRow rows in result){cText_IO = InOutReplace(DateTime dDDate)}private static string InOutReplace(DateTime dDDateh) // Now I want to get current table column value if that value ok return some valuereturn 解决方案 Something like this:foreach (DataRow row in result){string cText_IO = InOutReplace(row, dDDate)Debug.Print(cText_IO);} private static string InOutReplace(DataRow rowTemp, DateTime dDDateTemp){if (rowTemp == null){return string.Empty;}return rowTemp["Date"].ToString();} 这篇关于获取方法内的表行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 11:12