If you want to get the highest entered records (transactions) in the current month you may write the query below select top 1 CourseID,count(*) as forms from dataform where month(DataFormDate)=MONTH(GETDATE()) group by CourseID order by forms desc when you want more than one records change the top 1 to the desired numbered.
If you have an array of Integers and want to convert it into comma separated string. here is the following code //integer Array int[] arr = new int[5] {1,2,3,4,5}; string arrvalue= string.Join(",", arr); results will be arrvalue= "1,2,3,4,5"