Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 16, 2010 04:29 PM by ricka6
Feb 16, 2010 11:35 AM|LINK
I am new in ASP.Net MVC and facing problam to insert data into database.I am using
LINQ to SQL(test.dbml) and Model1.edmx
My controller code is bellow
Function Index() As ActionResult
Dim db = New dbTestEntities() ' dbTest is my database
Dim testtable = New dbtestTable()
Dim mytest = New testDataContext()
testtable.Customer_ID = 3
testtable.Company = ""
testtable.First_Name = ""
testtable.Last_Name = ""
db.AddToTestTable(testtable) 'TestTable is my database table
This code show ERROR Invalid column name
Is this Code is correct ?, IF any other solution is avalable plese tell me.
"ASP.NET MVC" HtmlHelper ActionLink "Unit Tests"
"asp.net mvc rc"
"ASP.NET MVC 1.0"
"ASP.NET MVC v1.0"
"LINQ to SQL"
MVC Blinq Linq to SQL
asp.net to MVC
Feb 16, 2010 01:19 PM|LINK
See and actually DO the movie database tutorials:
Create a Movie Database Application in 15 Minutes with ASP.NET MVCView in
The above uses LINQ to Entities.
Creating Model Classes with the Entity FrameworkView in
Creating Model Classes with LINQ to SQLView in
Once you have them working, you should have a sufficient degree of understanding to attack your own related LINQ problems.
Note that syntactically, LINQ to SQL and LINQ to Entities are sufficiently similar to each other so as to not pose much of a challenge to you.
Feb 16, 2010 04:29 PM|LINK
IF you can use EF (the future direction of MS), My sample is better, more complete and doesn't waste time creating a DB (90% of the other tutuorials - and that has nothing to do with MVC).
How to: Validate Model Data Using DataAnnotations Attributes
Walkthrough: Using Templated Helpers to Display Data