Abey Varghese

Abey Varghese

  • NA
  • 18
  • 7.3k

Error in Update, Using Entity Framework model

Jan 18 2013 4:57 PM
 
Hi,

 I am using Entity framework here, getting error like " An error occured while executing the command defenition".All database fiels are in correct order.  Need help.

public static bool UpdateCWEquipment(string dbLocation, Int32 eqSID, string eqUnitNumber, string descr,
           string manufacturer, string model, Int32 eqUnitID, bool isActive, decimal unitCost, string FEMACode,
       string ICMACode)
        {
         



            try
            {
                //grab the connection string
                string connString = ObtainConnectionString(dbLocation);

                //only continue if we have a connection string
                if ((!string.IsNullOrEmpty(connString)))
                {

                    using (CWUPTestEntities ctx = new CWUPTestEntities(connString))
                    {


                        try
                        {
                            //update the information
                            retCount = ctx.okc_UpdateEquipmentByEquipmentSID(
                                eqSID,
                                eqUnitNumber,
                                descr,
                                manufacturer,
                                model,
                                eqUnitID,
                                (isActive ? "ACTIVE" : "INACTIVE"),
                                unitCost,
                                DateTime.Now.ToShortDateString(),
                                ICMACode,
                                FEMACode                        
                                );

                         

                        }
                        catch (Exception Ex)
                        {
                            throw new Exception("Error in updating data", Ex);
                        }