For anyone having issues deleting multiple records, where it says "No definition for DeleteObject found", you could try the following. I am currently on EF 6.0.0.0. List students = db.Students.Where(x => studentIdsToDelete.Contains(x.Id)).ToList(); foreach(Student student in students) { db.Students.Remove(student); } db.SaveChanges(); return RedirectToAction("Index"); Replace the corresponding Student model with your own entity.
@kasthurimahesh63772 жыл бұрын
Thank you bro
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Hi Milivoje Genčić, thank you very much for taking time to answer this question. Keep up the good work of helping others. As, I am receiving lot of questions everyday from our youtube users, I am finding it extremely difficult to answer all the questions in time. With your help I am confident, we will be able to answer most questions in time. Appreciate your time and effort. God bless you.
@sunildesu363111 жыл бұрын
Ya its working Mr.Milivoje Genčić thank u thank u so much for spending ur valuable time.
@Ayubajbnabi11 жыл бұрын
Thanks allot Venkat for these helpful and simple and easy way of teaching. God bless you.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
I will record video on this very soon. For email alerts, when new videos are uploaded, please subscribe to my channel. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video.
@daviddonadze2217 жыл бұрын
Kudvenkat you are a Legend
@stillborn00711 жыл бұрын
Hi Venkat, this works great! I've been working with Guid, but it works in a sortlike way. Thanks!
@gabhishek1711 жыл бұрын
Thanks Venkat these videos for MVC are very very useful.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Sure, I will record and upload a video series on entity framework as soon as I can.
@nicon995 жыл бұрын
Fantastic series. Thank you so much!!
@mun4man10 жыл бұрын
Hi Venkat, I am really glad to have your Video tutorials, I am really benefited a lot from these tutorials, from this video I would like to understand the "DeleteObject" used for selected records to delete using EF 4, but I am not able to find the "DeleteObject in EF 5 or 6 versions, can you please help me how to resolve or replace the DeleteObject with other function. Thanks In Advance...
@kavithavishwanathen67788 жыл бұрын
same here ....did u get the solution? plz reply
@KhalidAfridi12 жыл бұрын
Hi kudvenkat thank you so much for such amazing vidoes. I have one question @13:37 how MVC knows which *EditorTemplates* to be used? still confusing... 🙃
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Sure Sunil, will do it as soon as I can.
@braScene8 жыл бұрын
Hi there, many thanks for your amazing videos mr. Venkat! I have one question: how can I make that checked box gets saved when I go to next page? e.g. if I select to delete employee number 1, then I go to next page and select another employee, this first one doesn't get saved, how to achieve this?
@shashikant201111 жыл бұрын
hi kudvenkat, I am a regular viewer of your video series. Could you please post a video on AES Encryption Technique and where passwords are stored for Encryption and Decryption.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
That's when we create View Specific Models, with only the properties that we need for the view. These are called as ViewModels. Hope this answers your question. Good Luck.
@gabhishek1711 жыл бұрын
thanks Venkat, please suggest on some basic videos on Entity Framework.
@kavithavishwanathen67788 жыл бұрын
Thank you my angel ......
@sunildesu363111 жыл бұрын
Hi Venkat, I saw part65 video which means Deleting Mutiple Rows in MVC, i fallow as it is what u have done in that video, but i got an error like "{ (does not contain a definition for 'DeleteObject' and no extension method 'DeleteObject' accepting a first argument of type could be found (are you missing a using directive or an assembly reference?)} Could u PLz Rectify this error Thanks
@AliHaider-bk7fm5 жыл бұрын
same error? solution?
@basheeral-momani20328 жыл бұрын
thank you very much for your hot topics
@Csharp-video-tutorialsBlogspot8 жыл бұрын
You are very welcome and Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful. I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you kzbin.infoplaylists?view=1&sort=dd If you need DVDs or to download all the videos for offline viewing please visit www.pragimtech.com/order.aspx Slides and Text Version of the videos can be found on my blog csharp-video-tutorials.blogspot.com Tips to effectively use my youtube channel. kzbin.info/www/bejne/r2ibYYCtnb5qZtU If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel. kzbin.info If you like these videos, please click on the THUMBS UP button below the video. May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them. Good Luck Venkat
@kitply13043 жыл бұрын
1)Have primary key in your table 2)LstDelete.ForEach(y => db.Employee.Remove(y)) in EF6 you will not get db.employee.removeobject() 3) db.SaveChanges()
@yasermahfouz62632 жыл бұрын
thank you
@omymma11 жыл бұрын
can you make videos on Entity Framework really is very good technology
@thefamilyexpress84268 жыл бұрын
Hello Sir, Thanx in Advance ! I tried Same Example but it was showing error like.. Error 1 'System.Data.Entity.DbSet' does not contain a definition for 'DeleteObject' and no extension method 'DeleteObject' accepting a first argument of type 'System.Data.Entity.DbSet' could be found (are you missing a using directive or an assembly reference?) D:\MVCProject\MvcDeleteMultipleRow\MvcDeleteMultipleRow\Controllers\HomeController.cs 22 42 MvcDeleteMultipleRow
@jayabharathi57235 жыл бұрын
The Family Express I have same problem ,did u solve it
@jayabharathi57235 жыл бұрын
The Family Express reply me
@abinayasankar26967 жыл бұрын
Hi Iam trying to retrieve the selected rows and put them in another view instead of deleting but the value passed to the controlled from the checkbox are getting passed as null... can you help me with that
@hendesebilisim7 жыл бұрын
Thank you Sir.
@AnasAlQudah3 жыл бұрын
Thanks
@ferozkhanzaheen31028 жыл бұрын
dear sir i used visual studio 2013 but there is no method "DeleteObject" is not available and using .net framework 4
@braScene8 жыл бұрын
Hi, there are many ways to do it without the DeleteObject method. Here's one way: [HttpPost] public ActionResult Delete(IEnumerable empsToDel) { List listToDelete = new List(); listToDelete = db.Employees.Where(x => empsToDel.Contains(x.ID)).ToList(); foreach (var itemDel in listToDelete) { foreach (var item in db.Employees) { if (itemDel.ID == item.ID) db.Employees.Remove(item); } } db.SaveChanges(); return RedirectToAction("Index"); }
@einar4387 жыл бұрын
You can save some of the list processing logic by simply replacing the call to DeleteObject with a different Action delegate as a lambda. .ForEach(y => db.Employees.Remove(y))
@sherazhassan25716 жыл бұрын
@@einar438 thanks ..This worked perfect
@sunildesu363111 жыл бұрын
Hi Venkat, i understand its difficult to give reply to all but my small request could u plz make how to set forgot password for sending a mail or give a security question like that procedure any one to reset password by using smtp. Thank u
@pahwarocks11 жыл бұрын
Hi Sir, There can you upload video related Drop down Change Value with Entity Framework, Like I have a User Registration form in which there are three Drop down like Country, State, City. I want to fire change event on Country Change or State Change. How do we solve with Entity Frame work. please share video related this issue.
@rashmishukla85588 жыл бұрын
dear sir ,can you please share a tutorial for web grid n mvc ?
@qingfan861211 жыл бұрын
in visual2012, How references DeleteObject method? vs2010 no problem. please help me,thank
@bishnukarki171410 жыл бұрын
what i think is we need one foreach loop in employee.cshtml that has all attributes and it has ienumerable model and also in the homecontroller.cs the deleteobject is not supported so use remove method. I have taken remove code from one of the friend who commented here... You can see the code here... @foreach(var item in Model) { .// al tr and td of Employee.cshtml inside this loop } public ActionResult Delete(IEnumerable employeeIdsToDelete) { IEnumerable employeesToDelete = db.Employees.Where(x=> employeeIdsToDelete.Contains(x.id)) .ToList(); foreach (var emp in employeesToDelete) { db.Employees.Remove(emp); } db.SaveChanges(); return RedirectToAction("Index"); }
@sungju12039 жыл бұрын
+bishnu karki Hello my friend. did you come up with solution here? i'm having same problem with you. DeleteObject isnt working for me... How did you resolve this issue?
@bishnukarki17149 жыл бұрын
Harry Hur Harry, I have the working code in comment section. Thats what worked for me. I am sure this works for you too!!!
@dima_vinogradov10 жыл бұрын
You shouldn't have multiple elements in the DOM with the same id, the name is good as they are bound this way and are passed to the controller but the id there is simply incorrect.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
monster.com is an example
@mun4man10 жыл бұрын
Sorry to trouble you Venkat, I got the solution.
@sungju12039 жыл бұрын
+Madhu Babu Hello my friend. did you come up with solution here? i'm having same problem with you. DeleteObject isnt working for me... How did you resolve this issue?
@mun4man9 жыл бұрын
I did it through angular js script Harry, and above Video is works for all the situations. Good Luck.