ado.net如何将记录集中第一张表ds.Tables[0]直接导入字符串数组string[] str中。类似形式为:string[] str = ds.Tables[0]..... ado.net如何将记录集中第一张表ds.Tables[0]直接导入字符串数组string[] str中。类似形式为:string[] str = ds.Tables[0]..... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string[] str = new string[ds.Tables[0].Rows.Count];for(int i = 0; i < str.Length; i++){ str[i] = ds.Tables[0].Rows[i][0];//不知道你要哪一列,这里以每行第一列为例} 漏了str[i] = ds.Tables[0].Rows[i][0].ToString(); string[,] str = new string[dt.Rows.Count, dt.Columns.Count]; for (int i = 0; i < dt.Rows.Count; i++) for (int j = 0; j < dt.Columns.Count; j++) str[i, j] = dt.Rows[i][j].ToString(); 我的意思是不用循环,有没有类似的成员函数用一个语句就能实现。如我假想的:string[,] str = ds.Tables[0].直接导入数组; c#ToList疑惑,求解 用过Discuz.Control.Button的来看下 100分相赠 如何批量改变图片大小。 C#急求关于整数转换问题~应该超简单的! 关于用C#做的一个计算器小程序的若干问题 如何截获 文件打开 保存 删除时的信息 问个超简单问题. 保存图片到MSSQL及从中取出的问题? .NET大局观这本书的电子版在哪里下载? 我想请教一条查询语句,急!! 未将对象引用设置到对象的实例 用reflector查看一个程序集的代码,翻译成的语言可以选C# VB.net IL,然后还有一个chrome...这个chrome是什么语言?
string[] str = new string[ds.Tables[0].Rows.Count];
for(int i = 0; i < str.Length; i++)
{
str[i] = ds.Tables[0].Rows[i][0];//不知道你要哪一列,这里以每行第一列为例
}
str[i] = ds.Tables[0].Rows[i][0].ToString();
string[,] str = new string[dt.Rows.Count, dt.Columns.Count];
for (int i = 0; i < dt.Rows.Count; i++)
for (int j = 0; j < dt.Columns.Count; j++)
str[i, j] = dt.Rows[i][j].ToString();
string[,] str = ds.Tables[0].直接导入数组;