I am getting following error in my query System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Distinct'. I have searched the Google but didn’t find any helpful solution according to my query.My query is this
SqlCommand myCommand = new SqlCommand("select ItemId,Distinct Size from ItemTilesSizes ",
myConnection);
My table name is ItemTilesSizes and it has two columns
ItemId Size
1 8x13
1 8x12
5 8x10
5 8x12
5 8x13
8 10x10
8 4x4
9 8x12
14 8x13
15 8x10
15 24x24`
DISTINCThas to come first, but it’ll get you all distinct pairs ofItemIdandSize. Is that what you want or were you looking for something else?