本文介绍了匹配数据,数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我有这个数据表dt3,看起来像: ADminNo PaperNo 111411H 3 111411H 18 172828z 3 172828z 18 111380Y 93 111938S 10 如何得到类似的东西: ConflictingPaper Numberofstudents AdminNo 3:8 2 111411H 172828z 等等。 填充数据网格视图。 i尝试类似: Dim curadminno As String = String .Empty curadminno = dr3( AdminNo)。ToString Dim z,k As 整数 对于 z = 0 dt3.Rows.Count 如果 dt3.Rows(z).Item( 0 )= curadminno 然后 DataGridView3.Rows.Add( String .Format( { 1}:{1},_ dr3( PaperNo ).ToString())) 虽然错了。 感谢任何人都可以帮我解决这个问题! 谢谢!解决方案 所以...你可以使用以下查询: SELECT t1.AdminNo,COUNT(t1.AdminNo) AS NumberOfStudents FROM @ tmp AS t1 GROUP BY AdminNo HAVING COUNT(AdminNo )> 1 它将返回与上面相同的结果,但没有 ConflictingPaper 列。 如何从MS Access数据库中获取数据?请阅读:从.NET应用程序访问Microsoft Office数据 [ ^ ] [/ EDIT] Hi, i have this datatable dt3 which looks like:ADminNo PaperNo111411H 3111411H 18172828z 3172828z 18111380Y 93111938S 10How to i get something like:ConflictingPaper Numberofstudents AdminNo3 : 8 2 111411H 172828zso on and so forth.To populate in a datagridview.i tried something like:Dim curadminno As String = String.Empty curadminno = dr3("AdminNo").ToString Dim z, k As Integer For z = 0 To dt3.Rows.Count If dt3.Rows(z).Item(0) = curadminno Then DataGridView3.Rows.Add(String.Format("{1}:{1}", _ dr3("PaperNo").ToString()))its wrong though.appreciate if anyone could help me out with this!Thanks! 解决方案So... You can use below query:SELECT t1.AdminNo, COUNT(t1.AdminNo) AS NumberOfStudentsFROM @tmp AS t1GROUP BY AdminNoHAVING COUNT(AdminNo)>1It will return the same result as above, but without the ConflictingPaper column.How to fetch data from MS Access database? Please, read this: Accessing Microsoft Office Data from .NET Applications[^][/EDIT] 这篇关于匹配数据,数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-09 01:05