如何在1个网格视图中使用不同数据库表的不同列? [英] How to use different columns of different tables of database in 1 grid view?

查看:79
本文介绍了如何在1个网格视图中使用不同数据库表的不同列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我正在尝试使用Microsoft SQL Server 2012在C#中进行拍卖。我有一个用户表,其中包含所有详细信息,以及一张主要价格的商品表。用户应该能够在他们的个人资料中为商品定价,然后应用程序的管理员可以在一个网格视图中查看他们所做的总结果,它应该像一个Excel工作表,其中有一个名称列,商品名称列,和其他列数必须取决于可用商品代码的数量。我的意思是一个动态的。

但是因为我是这些东西的新手,我有点困惑,最好的方法是什么。



我尝试了什么:



i认为最好还有另一张表,其中id为user,id为good,和用户建议价格,但后来我不知道如何使用它们。

解决方案

使用加入概念..





内部加入

正确加入

左加入



查询


hey guys, i am trying to program an auction in C#, using Microsoft SQL Server 2012. i have a table of users with all of their details, and a table of goods with their main price. users should be able to price the goods in their profile, and then the admin of application can check the total results of what they have done in one grid view, it should be like an Excel sheet which has a name column , goods name column, and other columns count must be depended to number of codes of goods available. i mean a dynamic one.
but since i'm new to such stuffs i'm a little confused what is the best way to do this.

What I have tried:

i thought it's better to have another table which has the id of user, id of good, and users suggested price, but then i didn't know how to use them.

解决方案

Use The Joins Concept..

Like
Inner join
Right Join
Left Join

In Query


这篇关于如何在1个网格视图中使用不同数据库表的不同列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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