我也在做一个打印的问题,不过是票据打印,刚发的贴子,看到你的问题, 我昨天搞过,你的这个 SqlConnection Conn = new SqlConnection( ConnectionString );
string sql="select sum(a),sum(b),sum(C) from tables1 where workdate= '20071108 ' and brno in(select brno from tables2 where mbrno in( '4000 ', '4010 '))and currtype = '001 ' and subno like 'i% ' " SqlDataAdapter DA = new SqlDataAdapter( Sql,Conn ); DA.Fill( this.DS,"Customers" ); this.DataGrid.DataSource = this.DS.Tables[0]; 这样就绑定了,要打印Datagrid 发个QQ 或者邮箱过来.
简单来说就是一个求和语句,只是把求和得的SUM值显示在datagrid
主要自己不懂得在C#里面怎么弄这个datagrid
就是求一个简单的显示在datagrid事例
和打印datagrid里面的内容
我昨天搞过,你的这个
SqlConnection Conn = new SqlConnection( ConnectionString );
string sql="select sum(a),sum(b),sum(C) from tables1 where workdate= '20071108 ' and brno in(select brno from tables2 where mbrno in( '4000 ', '4010 '))and currtype = '001 ' and subno like 'i% ' " SqlDataAdapter DA = new SqlDataAdapter( Sql,Conn );
DA.Fill( this.DS,"Customers" ); this.DataGrid.DataSource = this.DS.Tables[0];
这样就绑定了,要打印Datagrid 发个QQ 或者邮箱过来.