数据集填充 [英] dataset fill

查看:70
本文介绍了数据集填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL =从ClientReceiptInfo中选择Sno,TransactionsType,QuoteDate,Math,TotalPayment,transactionbalance,其中clientcode =" & client_customer_detail.textbox1.Text& " Union ALL Select Sno,TransactionsType ,来自客户发票信息的报价日期,数学,总付款,交易余额,其中clientcode =" 按QuoteDate排序" span>

SQL ="Select Sno ,TransactionsType,QuoteDate,Math,TotalPayment,transactionbalance from ClientReceiptInfo where clientcode=" & client_customer_detail.textbox1.Text & "Union ALL Select Sno,TransactionsType,QuoteDate,Math,TotalPayment,transactionbalance from clientinvoiceinfo where clientcode=" & client_customer_detail.textbox1.Text & "order by QuoteDate"

Da = New SqlDataAdapter(SQL,Con)

Da =New SqlDataAdapter(SQL, Con)

Da.SelectCommand.ExecuteNonQuery()

Da.SelectCommand.ExecuteNonQuery()

ds As 数据集

 Dim ds As New DataSet

 

Da.Fill(ds," ;  < )                                                

Da.Fill(ds, "                ")                                                 

DataGridView1.DataSource = ds.Tables("

DataGridView1.DataSource = ds.Tables("         ")

我在 "中输入的内容"因为我将select查询用于两个sql数据库表只显示在datagrid视图中,所以表名是什么我输入了(  ")

what i put in "  " because im using select query for  two sql database table  only show in datagrid view so whats the table name  i put in ("   ")

推荐答案

我相信,如果您从查询语句返回了多个表,那么您可以仅使用将"ds"作为参数的单个参数重载. -这些表将被赋予通用名称.

I believe that if you have multiple tables returned from a query statement then you can just use the single argument overload that takes in "ds" -- the tables will be given generic names.

尽管我很困惑...我以为UNION会返回一个单一表,该表是两个Select的合并结果.在Management Studio中运行此查询的等效表时是否得到两个表?

Although I'm confused...  I thought a UNION will return one single table that is the combined results of both Selects.  Are you getting two tables when you run the equivalent of this query in Management Studio?


这篇关于数据集填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆