Your c# code to construct the emply column.
public static string show(int r)
{
if (r > 0)
{
List<string> list = new List<string>();
for (int i = 0; i < r; i++)
{
list.Add("'' as emplty_column" + (i + 1));
}
return string.Join(",", list);
}
return "";
}
string val = show(5);
string strquery = @"SELECT a.str_typeid, a.str_typename, a.str_status, a.strlst_user,
a.dt_entdate" + ((val == "") ? "" : ","+val) + @"
FROM ref_productitem_disc a";
Your strQuery will the query.