从数据库中显示datagridview中的记录

编程入门 行业动态 更新时间:2024-10-25 09:26:09
本文介绍了从数据库中显示datagridview中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在数据库记录中如下 房间课程 1 AFF 2 MFA 3 REO 4 SAC 5 MFA 6 PST 7 RM 8 MC i希望使用c# 房间课程房间课程 1 AFF 5 MFA 2 MFA 6 PST 3 REO 7 RM 4 SAC 8 MC 注意它是windows应用程序 Rgds, Narasiman P

In database records as follows Room Course 1 AFF 2 MFA 3 REO 4 SAC 5 MFA 6 PST 7 RM 8 MC i want to display the record in datagridview as follows using c# Room Course Room Course 1 AFF 5 MFA 2 MFA 6 PST 3 REO 7 RM 4 SAC 8 MC Note it is windows application Rgds, Narasiman P

推荐答案

从数据集中划分记录并将其绑定到gridview是不可行的,更好地划分它在StoredProcedure中作为两列a nd将其返回给应用程序并捕获数据集中的数据并将其绑定到gridview。 存储过程将是 its not feasible to divide the records from dataset and bind it to the gridview, better divide it in the StoredProcedure as two columns and return it to the application and catch the data in a dataset and bind it to the gridview. the stored procedure will be select d.* into #temp_tab from( select row_number() over(order by name) rno, User_Id, name, from TableName a inner join select a.User_ID ID,a.name NAME from (select row_number() over(order by name) new_rno ,* from #temp_tab where rno%2=1) a left outer join (select row_number() over(order by name) new_rno ,* from #temp_tab where rno%2=0) Drop table #temp_tab;

它会将记录分成两个列。 希望它有帮助

it will divide the records into two colummns. Hope it helps

更多推荐

从数据库中显示datagridview中的记录

本文发布于:2023-10-19 14:57:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1507863.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库中   datagridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!