如何在SQL Server 2005中的表中添加数据 [英] How to add data in table in sql server 2005

查看:73
本文介绍了如何在SQL Server 2005中的表中添加数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好所有访客
我在sql server 2005中有2个表.它们是SaleHeader和SaleDetail
SaleHeader(shcode,custcode,empcode,saledate,amount)
saledetail(sdcode,shcode,itemcode,数量,折扣).

我在该表上创建了数据集(在vb.net中),并为SaleHeader选择了Detail(not Grid)以显示在表单上,​​并且还定义了客户代码和empcode以表客户和员工.它可以保存到SaleHeader中.

---问题出在SaleDetail --------
对于SaleDetail,我选择Grid(在vb.net中).但是当我将其放到窗体(上面的窗体)上时,它显示所有(sdcode,shcode,itemcode,数量,折扣).我不想在那个网格中显示(sdcode,shcode).我该怎么办那?
以及如何将sdcode和shcode保存到表SaleDetail中?


最好的问候,

Hi all visitors
i have 2 tables in sql server 2005.they are SaleHeader and SaleDetail
SaleHeader(shcode,custcode,empcode,saledate,amount)
saledetail(sdcode,shcode,itemcode,qty,discount).

i created dataset (in vb.net) to that tables and for SaleHeader, i choose Detail(not Grid) to show on the form and i also define the custcode and empcode to table customer and employee.and it can save to the SaleHeader.

---The problem is in SaleDetail--------
For the SaleDetail, i choose Grid (in vb.net). but when i drop it to the form(the form above), it show all(sdcode,shcode,itemcode,qty,discount).I dont want to show (sdcode,shcode) in that grid.How can i do that?
and How can i save sdcode and shcode to table SaleDetail?


Best Regards,

推荐答案

通过DataGrid属性或代码使所需的列不可见
make desired columns invisible, from DataGrid properties or by code


这篇关于如何在SQL Server 2005中的表中添加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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