I can't find the error in the code but it showing me.
System.Data.SqlClient.SqlException: 'Incorrect syntax near ')
My code is here:
private void ShowChart()
{
string UserID = "";
for (int Counter = 0; Counter < UID.Count - 1; Counter++)
{
UserID += UID[Counter].ToString() + ",";
}
UserID = UserID.Substring(0, UserID.Length);
string[] ListFamily = { };
int[] ListTime = { };
var Query = Database.Database.SqlQuery<Vw_ShowChartInfo>("Select * From Vw_ShowChartInfo Where UserID In (" + UserID + ")").ToList();
for (int I = 0; I < Query.Count; I++)
{
Family.Add(Query[I].FullName.ToString());
Time.Add(Convert.ToInt32(Query[I].TotalTime));
ListFamily = Family.ToArray();
ListTime = Time.ToArray();
}
this.Chart.Series.Clear();
this.Chart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Pastel;
this.Chart.Titles.Add("نمودار کارکرد پرسنل");
for (int II = 0; II < ListFamily.Length; II++)
{
Series series = this.Chart.Series.Add(ListFamily[II] + "-" + Query[II].TotalTime);
series.Points.Add(ListTime[II]);
}
}