Hi,
I have created a master table for the coloums classID and ClassName,i want a mvc form with entityframework to display or to make use
of that data in the other application.
Thanks & Regards
Rizwan
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suraj SahooPosted Mar 10, 2015, 2:06 AM
Based on your latest query, you need to do this in the javascript file using jquery. Based on the dropdown value change, take the dropdown selected value and make an ajax call to get the other value to be updated from the table.
Please check the below fiddle for some information.
http://jsfiddle.net/taditdash/9Kfnt/
I hope this idea surely helps you. You just need to add the ajax call into the Onchange function of the dropdown. Retrieve the value from table in ajax and inside the ajax sucess function add the value wherever you want.
Accept If helps you.
Thanks
Mohammed RizwanullahPosted Mar 10, 2015, 1:08 AM
I have two tables,student and class, i have taken the values of student name in the dropdown list , now when i select the name in the dropdownlist i want to dispaly the respective classname from the table,.could you plz help me with the query and where to write it in mvc.
Thanks
Rizwan
Suraj SahooPosted Mar 9, 2015, 2:56 AM
You can try and use a Partial class that will extend the main class which has FirstName and LastName as properties.
Then in the Partial class have a property called FullName and since it extends the main class, whenever it is called you can have a property fullName in access too which you can use to set the dropdown.
http://www.codeproject.com/Articles/709273/Partial-Classes-in-Csharp-With-Real-Example
I hope you understand
Accept if helps you.
Thanks
Mohammed RizwanullahPosted Mar 7, 2015, 2:54 AM
I have two columns in the database, firstname,lastname, i want to concat two names and want to produce as Fullname in dropdownlist.is there any help?
Thanks
Rizwan
Mohammed RizwanullahPosted Mar 5, 2015, 2:49 AM
This is Rizwan,i already sent the Database of MVCDB, there are two tables, i want to create a third with StudentName in dropdown,when we select student name,student class should be displayed, could you plz help me out in mvc 3 with EF.
Thanks
Rizwan
Mohammed RizwanullahPosted Mar 4, 2015, 2:40 AM
am creating a mvc app to perform CRUD, but to perform Create, it stores only one time
the ID field does not increament,
help me out with this.
Thanks
Rizwan
Ravi PatelPosted Mar 3, 2015, 5:38 AM
I checked your source code you are not using Entity Framework Database first approach
Please go to msdn https://www.asp.net/mvc/overview/getting-started/database-first-development/setting-up-database
and download visual studio 2013 http://www.visualstudio.com/
Mohammed RizwanullahPosted Mar 3, 2015, 3:02 AM
Ravi PatelPosted Mar 3, 2015, 2:24 AM
where you uploaded i did not get any database backup file
take the database backup and compress that database backup in zip or rar formate then upload
Mohammed RizwanullahPosted Mar 3, 2015, 1:39 AM
Mohammed RizwanullahPosted Mar 3, 2015, 12:55 AM
Ravi PatelPosted Mar 3, 2015, 12:43 AM
attach your database back up file here
Mohammed RizwanullahPosted Mar 3, 2015, 12:20 AM
Ravi PatelPosted Mar 2, 2015, 8:10 AM
if you are using strongly view
dbContext.User.Add(users); // here User is your Model class name
Mohammed RizwanullahPosted Mar 2, 2015, 5:06 AM
Sir i have gone through your link, the data is listing in index view,but unable to create, update,edit or delete.
Ravi PatelPosted Feb 25, 2015, 4:23 AM
check this link
http://www.c-sharpcorner.com/UploadFile/1492b1/connecting-the-mvc-application-with-the-help-of-entityframew/
Suraj SahooPosted Feb 25, 2015, 3:38 AM
Now since you have your database and tables ready, you can follow Entity Framework DB-First approach.
http://www.entityframeworktutorial.net/database-first-with-entity-framework.aspx
Then you need to establish an Ado.Net Entity Model connection to the MVC project, which you will find in the Add New Item template in the DATA section.
Then after the connection is established, you need to use the context to be able to access the data records in the table, more information you will get from the link.
Accept if helps anyway.
Thanks