使用存储过程从两个不同的表中返回值

问题描述:

朋友们,
我想使用存储过程将两个不同的表值作为一个表返回给C#数据表.
表格1-标准细节
栏:标准姓名;
表2-学年
列:从年到年.
在存储过程中,我想将这三列作为新表返回给c#datatable.请帮我创建存储过程.
谢谢

Hi friends,
i want to return two different table value as one table to c# datatable using store procedure.
table 1- standered-details
column:standered name;
table 2- acadamic year
column: year from,toyear.
In store procedure i want to return these three column as a new table to c# datatable. plase help me to create store procedure.
advance thanks

这对您来说微不足道,对我们而言也是不可能的.也许您应该阅读一些有关SQL如何工作的文章?您可以将两个表连接在一起以在它们之间获取数据,只要它们具有相同的字段,就可以在行级使用它们将它们连接在一起.没有这样的列,就无法将数据链接在一起,除非只需要一行,然后就可以将值读入变量,然后选择那些值来创建具有所需数据的表.

但是,我们无法执行任何操作,因为我们不知道您的表的架构.但是,再说一次,如果有可能,那么它也是微不足道的,所以您应该做一些阅读,然后尝试自己动手做,这样您就可以学习编程,而不是学习要求所有基本知识.在这里提问,让我们为您做.当然,如果您遇到困难,我们很乐意为您提供帮助.
This is both trivial for you to do, and impossible for us to do. Perhaps you should read some articles on how SQL works ? You can join two tables together to get data between them, so long as they have a common field you can use to join them together on the row level. Without such a column, there''s no way to link the data together, unless you only want one row, then you can read your values in to variables, and select those to create a table with the data you need.

But, we can''t do any of that, as we don''t know the schema of your tables. But, again, if it''s possible at all, then it''s also trivial, so you should do some reading, and try to do it for yourself, so you learn to program, instead of learning to ask all your basic questions here and have us do it for you. Of course, if you get stuck, we''re happy to help.