daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // get the connection ready
  2. SqlConnection myConnection = new SqlConnection(ConnectionString);
  3. SqlCommand myCommand = new SqlCommand(CommandText, myConnection);
  4. myCommand.CommandTimeout = ConfigSettings.SqlCommandTimeout;
  5.  
  6. SqlParameter workParam = new SqlParameter();
  7.  
  8. myCommand.CommandType = CommandType.StoredProcedure;
  9.  
  10. // Set the input parameter, companyid, branchid, departmentid
  11. // these parameters are set in the sub page_load
  12. myCommand.Parameters.Add("@CompanyID", SqlDbType.NVarChar).Value = CompanyID;
  13. myCommand.Parameters.Add("@BranchID", SqlDbType.NVarChar).Value = BranchID;
  14. myCommand.Parameters.Add("@DepartmentID", SqlDbType.NVarChar).Value = DepartmentID;
  15. // open the connection
  16. myConnection.Open();
  17. SqlDataReader reader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
  18.  
  19. BarChart1.DataSource = reader;
  20. BarChart1.Series[0].ValueMemberX = "ProductName";
  21. BarChart1.Series[0].ValueMembersY = "TotalPurchase";
  22. BarChart1.DataBind();
RAW Paste Data
Top