i have highlighted in red where am getting the error.
public void BindGrid()
{
// Load the name of the stored procedure where our data comes from here into commandtext
string CommandText = "enterprise.spCollectionAlerts";
// get the connection ready
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand(CommandText, myConnection);
myCommand.CommandTimeout = ConfigSettings.SqlCommandTimeout;
SqlParameter workParam = new SqlParameter();
myCommand.CommandType = CommandType.StoredProcedure;
// Set the input parameter, companyid, branchid, departmentid
// these parameters are set in the sub page_load
myCommand.Parameters.Add("@CompanyID", SqlDbType.NVarChar).Value = CompanyID;
myCommand.Parameters.Add("@BranchID", SqlDbType.NVarChar).Value = BranchID;
myCommand.Parameters.Add("@DepartmentID", SqlDbType.NVarChar).Value = DepartmentID;
// open the connection
myConnection.Open();
SqlDataReader reader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
BarChart1.DataSource = reader;
BarChart1.Series[0].ValueMemberX = "ProductName";
BarChart1.Series[0].ValueMembersY = "TotalPurchase";
BarChart1.DataBind();
CategoryAxisLineColor="#D08AD9" ValueAxisLineColor="#D08AD9" BaseLineColor="#A156AB">

Nilesh ShahRank #42 · 34.2K reputationPosted Dec 7, 2017, 3:44 AM EST
Nilesh ShahRank #42 · 34.2K reputationPosted Dec 7, 2017, 3:19 AM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 7, 2017, 3:34 AM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 7, 2017, 3:55 AM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 7, 2017, 10:02 PM EST