.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Microsoft.ApplicationBlocks.Data 中的问题

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

Microsoft.ApplicationBlocks.Data 中的SqlHelper类中有一个非常要命的问题。在使用SqlHelper.FillDataSet系列函数时,如果DataSet中包含的数据表多余2个,那只能给头两个数据表指定名称后面的就会变成Table3...n..
查看其源代码:

//Add the table mappings specified by the user
if (tableNames != null && tableNames.Length > 0)
{
 string tableName = "Table";
 for (int index=0; index < tableNames.Length; index++)
 {
  if( tableNames[index] == null || tableNames[index].Length == 0 ) throw new ArgumentException( "The tableNames parameter must contain a list of tables, a value was provided as null or empty string.", "tableNames" );
  dataAdapter.TableMappings.Add(tableName, tableNames[index]);
  tableName += (index + 1).ToString(); //问题就在这里,从第2个表开始tableName不是以“table2...tableN“的方式递增,而是以“table12,table123,table1...n“的方式递增。写成这样的方式就好了
tableName = "Table" + (index + 1).ToString();

 }
}




相关文章

相关软件