Inserting Data using EF with MVC4.
I think you can add EF in your project.
Then open model1.edmx or what ever is the name of your file .noe go to it property and change the property CODE GENERATION STRATEGY to default.
Now delete the 2 xyz.tt file from the model1.edmx.
using PROJECT_NAME.model
den u can add your model entity as
modelentities obj= new modelentities ();
then creating a function in the controller as .
obj1.atribute1= value;// adding string value
obj1.attribute2=convert.toint32(value); // adding an int value
modelentities obj= new modelentities ();
then creating a function in the controller as .
public void addintotable()
{
table1s obj1= new
table1s();obj1.atribute1= value;// adding string value
obj1.attribute2=convert.toint32(value); // adding an int value
// you can add as many as atttribute you ant to add .
}
Comments
Post a Comment