(DataSet里就一张表)主要目的是想将DataSet中的表上的数据做SQL的查询处理
不知道是否直接就有方法... 如果没有的话想先把DataSet的数据导到SQL上的一个临时表中(按照DataSet中的表结构建,最好连数据也直接过去)
然后执行SQL得到结果
不知道是否直接就有方法... 如果没有的话想先把DataSet的数据导到SQL上的一个临时表中(按照DataSet中的表结构建,最好连数据也直接过去)
然后执行SQL得到结果
解决方案 »
- 要统计20个字段值为1的行数,怎么写简单?
- 在GridView中,如何去除最后一行的超链接?
- 如何用C#读取手机联系人(包括sim卡的)!!!
- 请问 关于 IDataCommand 的 问题
- 紧急! 考试题--->画图:给你三个点,请画一个基于这三个点的圆.
- 试图创建 UI.baseForm 的实例时发生异常。异常为“未找到类型 UI.baseForm 上的构造函数。”。
- 电子商务,多订单同时提交,程序如何处理,在线等~~~~~~
- 安装dotFrameWork的时候提示:stup can not access windows installer component;操作系统是xp个人版,请高手帮忙,急死了!!!!!!
- xml16进制数据转为图片
- 如何做一个游戏的多开器?
- 怎样从DataSet中读取表结构然后在SQL上建一个对应的表
- 请问使用ADO.NET的高手
private static void GetRowsByFilter()
{
DataTable customerTable = new DataTable( "Customers" );
// Add columns
customerTable.Columns.Add( "id", typeof(int) );
customerTable.Columns.Add( "name", typeof(string) ); // Set PrimaryKey
customerTable.Columns[ "id" ].Unique = true;
customerTable.PrimaryKey = new DataColumn[] { customerTable.Columns["id"] }; // Add ten rows
for( int id=1; id<=10; id++ )
{
customerTable.Rows.Add(
new object[] { id, string.Format("customer{0}", id) } );
}
customerTable.AcceptChanges(); // Add another ten rows
for( int id=11; id<=20; id++ )
{
customerTable.Rows.Add(
new object[] { id, string.Format("customer{0}", id) } );
} string strExpr;
string strSort;
strExpr = "id > 5";
// Sort descending by column named CompanyName.
strSort = "name DESC";
// Use the Select method to find all rows matching the filter.
DataRow[] foundRows =
customerTable.Select( strExpr, strSort, DataViewRowState.Added );
PrintRows( foundRows, "filtered rows" ); foundRows = customerTable.Select();
PrintRows( foundRows, "all rows" );
}private static void PrintRows( DataRow[] rows, string label )
{
Console.WriteLine( "\n{0}", label );
if( rows.Length <= 0 )
{
Console.WriteLine( "no rows found" );
return;
}
foreach( DataRow r in rows )
{
foreach( DataColumn c in r.Table.Columns )
{
Console.Write( "\t {0}", r[c] );
}
Console.WriteLine();
}
}
之类的语句从多个数据库中分别取得结果
然后将结果合并放在一个表AAA里
再执行一遍类似于select sum(aa), b , min(cc) , max(dd) from AAA 的语句来获得最终结果
C#中使用SQL Server分布式管理对象(SQL-DMO)
http://dotnet.aspx.cc/ShowDetail.aspx?id=BCEAADFB-CFF3-4804-B3B3-6C7D6488982B
INF: How to Enumerate Available SQL Servers Using SQLDMO
http://support.microsoft.com/default.aspx?scid=287737