Part 65 Deleting multiple rows in mvc

  Рет қаралды 84,024

kudvenkat

kudvenkat

Күн бұрын

Пікірлер: 56
@rishikmani
@rishikmani 4 жыл бұрын
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.
@kasthurimahesh6377
@kasthurimahesh6377 2 жыл бұрын
Thank you bro
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
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.
@sunildesu3631
@sunildesu3631 11 жыл бұрын
Ya its working Mr.Milivoje Genčić thank u thank u so much for spending ur valuable time.
@Ayubajbnabi
@Ayubajbnabi 11 жыл бұрын
Thanks allot Venkat for these helpful and simple and easy way of teaching. God bless you.
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
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.
@daviddonadze221
@daviddonadze221 7 жыл бұрын
Kudvenkat you are a Legend
@stillborn007
@stillborn007 11 жыл бұрын
Hi Venkat, this works great! I've been working with Guid, but it works in a sortlike way. Thanks!
@gabhishek17
@gabhishek17 11 жыл бұрын
Thanks Venkat these videos for MVC are very very useful.
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
Sure, I will record and upload a video series on entity framework as soon as I can.
@nicon99
@nicon99 5 жыл бұрын
Fantastic series. Thank you so much!!
@mun4man
@mun4man 10 жыл бұрын
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...
@kavithavishwanathen6778
@kavithavishwanathen6778 8 жыл бұрын
same here ....did u get the solution? plz reply
@KhalidAfridi1
@KhalidAfridi1 2 жыл бұрын
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-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
Sure Sunil, will do it as soon as I can.
@braScene
@braScene 8 жыл бұрын
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?
@shashikant2011
@shashikant2011 11 жыл бұрын
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-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
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.
@gabhishek17
@gabhishek17 11 жыл бұрын
thanks Venkat, please suggest on some basic videos on Entity Framework.
@kavithavishwanathen6778
@kavithavishwanathen6778 8 жыл бұрын
Thank you my angel ......
@sunildesu3631
@sunildesu3631 11 жыл бұрын
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-bk7fm
@AliHaider-bk7fm 5 жыл бұрын
same error? solution?
@basheeral-momani2032
@basheeral-momani2032 8 жыл бұрын
thank you very much for your hot topics
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 8 жыл бұрын
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
@kitply1304
@kitply1304 3 жыл бұрын
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()
@yasermahfouz6263
@yasermahfouz6263 2 жыл бұрын
thank you
@omymma
@omymma 11 жыл бұрын
can you make videos on Entity Framework really is very good technology
@thefamilyexpress8426
@thefamilyexpress8426 8 жыл бұрын
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
@jayabharathi5723
@jayabharathi5723 5 жыл бұрын
The Family Express I have same problem ,did u solve it
@jayabharathi5723
@jayabharathi5723 5 жыл бұрын
The Family Express reply me
@abinayasankar2696
@abinayasankar2696 7 жыл бұрын
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
@hendesebilisim
@hendesebilisim 7 жыл бұрын
Thank you Sir.
@AnasAlQudah
@AnasAlQudah 3 жыл бұрын
Thanks
@ferozkhanzaheen3102
@ferozkhanzaheen3102 8 жыл бұрын
dear sir i used visual studio 2013 but there is no method "DeleteObject" is not available and using .net framework 4
@braScene
@braScene 8 жыл бұрын
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"); }
@einar438
@einar438 7 жыл бұрын
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))
@sherazhassan2571
@sherazhassan2571 6 жыл бұрын
@@einar438 thanks ..This worked perfect
@sunildesu3631
@sunildesu3631 11 жыл бұрын
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
@pahwarocks
@pahwarocks 11 жыл бұрын
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.
@rashmishukla8558
@rashmishukla8558 8 жыл бұрын
dear sir ,can you please share a tutorial for web grid n mvc ?
@qingfan8612
@qingfan8612 11 жыл бұрын
in visual2012, How references DeleteObject method? vs2010 no problem. please help me,thank
@bishnukarki1714
@bishnukarki1714 10 жыл бұрын
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"); }
@sungju1203
@sungju1203 9 жыл бұрын
+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?
@bishnukarki1714
@bishnukarki1714 9 жыл бұрын
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_vinogradov
@dima_vinogradov 10 жыл бұрын
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-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
monster.com is an example
@mun4man
@mun4man 10 жыл бұрын
Sorry to trouble you Venkat, I got the solution.
@sungju1203
@sungju1203 9 жыл бұрын
+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?
@mun4man
@mun4man 9 жыл бұрын
I did it through angular js script Harry, and above Video is works for all the situations. Good Luck.
Part 73   OutputCache attribute in mvc
11:39
kudvenkat
Рет қаралды 107 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Part 62   Implementing search functionality in asp net mvc
17:32
kudvenkat
Рет қаралды 209 М.
ASP.NET Core MVC Tutorial - Full Course to Build YOUR Passion Project!
3:40:07
Querying 100 Billion Rows using SQL, 7 TB in a single table
9:07
Arpit Agrawal (Elastiq.AI)
Рет қаралды 59 М.
Part 74   CacheProfiles in mvc
14:45
kudvenkat
Рет қаралды 75 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 215 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 2,2 МЛН
Part 77   Custom action filters in asp net mvc
20:52
kudvenkat
Рет қаралды 178 М.
Part 1   How to find nth highest salary in sql
11:45
kudvenkat
Рет қаралды 2 МЛН
How do SQL Indexes Work
12:12
kudvenkat
Рет қаралды 663 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН