protected double[] getValues(int ColumnCount)
{
double[] value = new double[ColumnCount];
SqlConnection conGetValue = new SqlConnection(ConfigurationManager.ConnectionStrings["connMSJ"].ConnectionString);
SqlCommand cmdGetValue = new SqlCommand("(SELECT * FROM DailyBudget WHERE (Username=@username)) EXCEPT (SELECT Username FROM DailyBudget WHERE Username=@username)", conGetValue);
cmdGetValue.Parameters.AddWithValue("@username", Master.getUsername);
conGetValue.Open();
SqlDataReader dtrGetValue = cmdGetValue.ExecuteReader();
try
{
int i = 0;
while (dtrGetValue.Read())
{
value[i] = Convert.ToDouble(dtrGetValue[i]);
i++;
}
}
finally
{
dtrGetValue.Close();
conGetValue.Close();
}
return value;
}
Where is my mistake? i want every columns value where Username = master.lblUsername but except the first column which is contain the username.