What will be the best practices in my code to prevent sql injection?
What will be the best practices to prevent sql injection? My client asked me to prevent sql injection. I used this structure for data inserting or updating public bool Add(GreenItem aGreenItem, Employee emp) { aGreenItem.GreenItemCode = new CommonBLL().GetMaxId("[GreenItemCode]", "[Processing].[GreenItem]", "GTM"); using (SqlConnection objConnection = Connection.GetConnection()) { SqlTransaction transaction = objConnection.BeginTransaction("SampleTransaction"); try { string query = … Read more