Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32062

Error in Update, Using Entity Framework model

$
0
0
 
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);
                        }


Viewing all articles
Browse latest Browse all 32062

Trending Articles