Skip to main content

Posts

Showing posts with the label EDMX

The function import 'DBEntities' cannot be executed because it is not mapped to a store function.

1. Open EDMX in to Design Mode 2. Click Model Browser then type the Store procedure name on search and press Enter.    It will highlight the store procedure. 3. If you already try to add this store procedure, then in some case it create Function when you have a return value on your SP.  other wise it will not create the function. remove all from function. 3. If your SP has no return type then you may can use a simple return type value like :   SELECT 1 as DefaultValue   if you already have return type then you don't need that. 4. Select the Store procedure from model browser-> right click -> Add function Import.   5. Check Complex and Click Get column Information 6. Click on Create New Complex type. 7. It will create Function and complex type for that Store Procedure. Click OK and Build your application.

sql auto increment jump

You resolve your auto increment  jumping from this http://stackoverflow.com/questions/14146148/identity-increment-is-jumping-in-sql-server-database you can also resolve the issue into another way if you are using EDMX. Before inserting data into table get the max id value from your table. int maxAge = context.Persons.Max(p => p.Age); Now add your increment number  maxAge+1   Map the id value with your table. NB: You table Identity specification : Is Identity Will be no.