I am fairly new to ASP.NET and I am trying to figure out how to use the entity framework model to data from a textbox field and store it in an existing field in a database which is available to the application .
I looked around on the internet and开发者_开发百科 some solutions were to use a detailView but that would require me to recode the entire page and I would like to avoid that.
Can anyone provide any inputs on how to go about that ?
Thanks !!
For an introduction to using EF with ASP.NET see the tutorials at http://asp.net/entity-framework/tutorials -- there are two series there for Web Forms and one for MVC. Both of them have examples of using textboxes.
var context = new MyEntities();
var myObject = new myObjectType();
myObject.myValue = myTextBox.Text;
context.myObjectTypes.Add(myObject);
context.SaveChanges();
精彩评论