I'm using dapper Query method to fetch a set of data from sqlite with left join, it does return the column i need but multiple times.
i tried these query on DB Browser it works fine,
string sql =
@"select a.id, a.alert_tag, lyr.layer_name, ln.line_name, t.task_name from alert_tag a
LEFT JOIN layer_group lyr on lyr.layerID = a.layer_group
LEFT JOIN line ln on ln.lineID = a.line
LEFT JOIN task t on t.taskID = a.task";
then i call it,
using (IDbConnection cnn = new SQLiteConnection(Tools.LoadConnectionString()))
{
var output = cnn.Query<dynamic>(sql);
return output.ToList();
}
List<dynamic> Alerttag_List = new List<dynamic>();
private void LoadDGVdata()
{
Alerttag_List = SqliteQuery_AlertTagModel.Load();
dgv_AlertTag.DataSource = Alerttag_List;
}
I expected to get result like these
| id | alert_tag | layer_name | line_name | task_name |
but i got these
| id | alert_tag | layer_name | line_name | task_name | id | alert_tag | layer_name | line_name | task_name |

var propCount = TypeDescriptor.GetProperties(Alerttag_List[0]).Countand tell me what it says? is it 5, or is it 10?PropertyDescriptorreference, but theRowBoundPropertyDescriptorthat dapper is exposing here is transient (generated on the fly per row). Also: what kind of grid is that? i.e. is thisDataGridView? or...? And: does this perhaps gain columns, i.e. you haveAutoGenerateColumns(or whatever) enabled, and it is adding them whenever you change the source?Query<YourType>) should be very reliable - the dynamic property API viaPropertyDescriptorhowever, is... twitchy