I am new to MVC and my company gave me one project based on MVC with a description do or die, so i didn't find any solutions from last few days. But after watching some of these videos i am now clear that how to start that project. Really HATS OFF to you VENKAT SIR..
@vladvlad22895 жыл бұрын
I was following someone else's tutorials to get this done, I've spent about 5 hours trying to wrap my head around it, then I came here and in 15 minutes I got it done! Awesome tutorials, thank you
@Csharp-video-tutorialsBlogspot5 жыл бұрын
Hello Vlad - Thank you very much. Means a lot. Reall glad you found our MVC course useful. I have organised all the ASP .NET MVC Course videos, slides and text articles in sequence on the following page. Hope you will find it handy. www.pragimtech.com/courses/asp-net-mvc-tutorial-for-beginners/ If you have time, can you please leave your rating and valuable feedback on the reviews tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Yes, it should as long as the same schema and metadata exists on the full-fledged SQL Server that you are switching over to. Thank you very much for taking time to give feedback. I am very glad you found these videos useful.
@rosw4911 жыл бұрын
Your tutorials are some of the best I have seen. Thank you.
@tejas84373 жыл бұрын
which other are rest of the best ?
@kaligasm19477 жыл бұрын
Another great video. What struck me was that you were able to interrogate the database with writing any SQL! Presumably you can use the approach shown in this video to interrogate much more complex queries (or views) in SQL Server provided those queries have already been written in SQL Server first. I'm going to try this out.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
HI David, yes, with business objects we usually use ado.net. Business objects use ado.net to retrieve data from the database. We will discuss, using business objects in a later video session.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
We will discuss about editing, deleting, updating data in our upcoming videos.
@emmazh647411 жыл бұрын
Your tutorial full of details and clear, really being a great helper . Thanks U.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Can you make sure that you have an object in "homepages" collection property where Id is 1. You can very easily check this by debugging your application. Also, please make sure to check the underlying table has a rows where Id = 1. Hope this helps. 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. Please share the link with your friends.
@SydurRahman218 жыл бұрын
Thank you venkat, I have complete part 8 without any error.... you are great!!!
@ajaychowdary53178 жыл бұрын
Employee employee = employeecontext.Employees.Single(emp => emp.EmpId == Id); i got a error here. how to slove otherwise forword to the code to my mail daggubati.ajay9@gmail.com
@ubaidrehmanqureshi8 жыл бұрын
bro how u made database?
@ajaychowdary53178 жыл бұрын
+Ubaid Qureshi it's sloved bro
@ubaidrehmanqureshi8 жыл бұрын
+Ajay Chowdary if u using visual studio 15 then we have SQL database options within that project. u used external database manager or the one which is inbuilt visual studio ?
@bablykiran95773 жыл бұрын
@@ajaychowdary5317 If u got ur mistk thn plz tell ,I hav same prblm.
@DineshKudale6 жыл бұрын
Thank you for sharing your valuable knowledge with us ! Very simple and nice video to understand ! Thanks a lot !
@evanflink707310 жыл бұрын
At 5:23 of the presentation, did you mean to say that you should manually type in a Connection String, similar to that shown at 3:27, in notepad? Because, unless I overlooked something, I did not get an automatic creation of that connection string when I created my EmployeeContext.cs file. I'm running VS 2013 Express. Otherwise, I find these tutorials very helpful.. Thanks very much!
@abhivaxs11 жыл бұрын
you change my attitude towards .net technology .....you are awesome....i have realy respect for you becoz you share a good video and understanble thinks .......please donot stop to upload new videos ....thanks
@kenmtb10 жыл бұрын
Excellent video series!! Thank you very much for posting. If you are getting errors like "The underlying provider failed on Open", check the error's details to find the inner exception. There can be more info to pinpoint what is wrong. You may have login issues or problems in your connection string in the config file. Check your database service to see if a password is enabled. If so you need to provide it in the config string or remove the password in the service.
@RocckeFella5 жыл бұрын
So If I have 100s of Model classes am I supposed to initialize them all in Application_start method?
@Csharp-video-tutorialsBlogspot11 жыл бұрын
They are pretty much the same. A class is a very general concept, where as entities are mapped to some objects that are usually saved to a database table. Example Employee, Student, Company etc. In my opinion there are the same.
@denizcalskan71111 жыл бұрын
i received a error when the program ran. it'S about "The underlying provider failed on Open." EntityExceptionwas unhandled by user code. its showing this code => Employee employee = employeeContext.Employees.Single(emp => emp.EmployeeId == id); can it be from connectionString ?
@antonykhomeriki26807 жыл бұрын
Same fom me . the solution sould be: 1) (In your sql server db) set column name "employeeId" to Primery key and (In your programm Models -> Employee.cs) add "[key]" (representing in using System.ComponentModel.DataAnnotations;) [Key] public int employeeId { get; set; } 2) Edit your connectionString: instead of server=localhost or server=. , insert there fully qualified server name: in my case it is "server=DESKTOP-301UN48\SQLEXPRESS;" you can see you connection name by right clicking in your connection (in sql server) choosing "properties" if it is not already shown at the right courner
@lbhatt7 жыл бұрын
Many thanks Anthony
@sumitbhardwaj29927 жыл бұрын
Many Many thanx Mr. Antony Khomeriki finally i solve this problem after 8 days with your help please give me your contact link like facebook or other social networking site.
@karunkumar42457 жыл бұрын
thank you Antony
@birendranathruidas65176 жыл бұрын
Thank you, Antony. It worked :)
@Csharp-video-tutorialsBlogspot11 жыл бұрын
To retrieve all the records, get rid of the Single() method. employeeContext.Employees.ToList() should return the complete list of employees in tblEmployee table. Hope this answers your question.
@Algebrodadio9 жыл бұрын
Do I need to make a separate connection string for every database table that I will access? Shouldn't I be able to tell the EmployeeContext class which connection string to use if I already have one?
@aldoblack59829 жыл бұрын
Aaron Wolbach I was thinking the same thing. I hope someone answers.
@aldoblack59829 жыл бұрын
Aaron Wolbach I got it. You can create a new class with models, and on Employee Context you can call it DBSet youName { get; set; } I think so, I have not tested it.
@ImranAnsariM11 жыл бұрын
Hi Guys people who are not able to move ahead with the database connection. Please note that when you install Entity Framework now from Nuget. It Downloads the Newest version which is EF 6.0.2. You need to do additional configuration changes to make it work, So i would prefer to suggest install from Nuget by Nuget Package manager condole and download EF 5.0 which is supported by this tuotrial. Steps:Go to Tools -> Library Package Manager->Package Manager Console and Type PM> Install-Package EntityFramework -Version 5.0.0 Hope this helps you all :)
@ImranAnsariM11 жыл бұрын
Yasar Mahmood Coz you might not have data in the table
@dkapper0111 жыл бұрын
Cool thanks
@ImranAnsariM11 жыл бұрын
nargeez backer Please you also help others by your knowledge :)
@QuyetNguyen-ie1jc11 жыл бұрын
I got the error "The underlying provider failed on Open." in line: Employee employee = employeeContext.Employee.Single(emp => emp.Id == id); even I changed to EF5.0.0 Pls help me out.
@Anilgollapalli10 жыл бұрын
Quyết Nguyễn im getting the same error if you solved it please tell me solution
@b0sStAB9 жыл бұрын
Thanks for this tutorials man! God bless you!
@XxImBlessedxX8 жыл бұрын
You should have shown us how to create the database, I managed to get it working but it would have saved me a lot of time trying to figure out how to connect to the database -_-
@ubaidrehmanqureshi8 жыл бұрын
bro having same issue. will u help me out
@brunothebeagleofficial8 жыл бұрын
FinalXChapter i am getting the same error, did you find any solution
@lifet48007 жыл бұрын
see asp.net tutorial for db
@jigneshvyas31057 жыл бұрын
Go through his series on SQL server. And mind that he is doing this for free.
@brianblackie94347 жыл бұрын
In case someone is watching this now.... Database script is here >>> csharp-video-tutorials.blogspot.co.nz/2013/05/part-10-working-with-multiple-tables-in.html
@vijay101510 жыл бұрын
We have to define the key in code as following after making empid as primary key in Database: [Key] public int empId {get;set; } then this example works like charm.
@kamacac8710 жыл бұрын
Many thanks Vijay. I was wondering and searching here and there how it was working fine in the video BUT not in my example where the table had a primary key. thanks, it works like charm....
@Mrkandy42210 жыл бұрын
Thanks man! that worked.
@shaheerahmad78187 жыл бұрын
And people are saying connection is wrong LOL
@abhisheksharma18967 жыл бұрын
Key is not working in my case actually its not getting the "key" keyword ... plzzz help me out I'm using version 4
@mohitaggarwal10377 жыл бұрын
+Abhishek kumar Sharma Did you solve it..
@vanchalakhotia136811 жыл бұрын
Dear Sir , Excellent explanation .Really like your video as it is very easy to understand. You explain very well. vancha
@anuragpandey595211 жыл бұрын
sirji u r great u made Dotnet a very easy language you are sachin tendulkar in the field of programming thank you so much sir
@lakshmi.m40729 жыл бұрын
Getting below error while running the app: The context cannot be used while the model is being created. This exception may be thrown if the context is used inside the OnModelCreating method or if the same context instance is accessed by multiple threads concurrently. Note that instance members of DbContext and related classes are not guaranteed to be thread safe. connection string in the config file :
@SixStringflyboy9 жыл бұрын
Love this tutorial series so far. One question: As someone who is experienced in other areas of .NET, I started with the MVC tutorial series. Where do we find the Sample database you use in this tutorial? Thanks! n122vu
@carminabernat9 жыл бұрын
+n122vu I was wondering the same thing.....
@saiavishkar20989 жыл бұрын
you need to create a sample database consisting of Employee table using SQL server or some other database systems
@SixStringflyboy9 жыл бұрын
That's what I ended up doing. I paused the video when he showed each table and just created them based on that.
@Mattague8 жыл бұрын
+n122vu For those of us lost even there, I've never done database before. How do I go about building my own sample database?
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Hi Rob, very sorry for not replying to your question in time. The problem is, I am getting too many questions and not finding time to reply to everyone on time. Hope you can help me, by answering some of the questions, for which you have answers. Coming to your question. Try this 1. Expand "References" folder from "Solution Explorer" 2. Delete the reference for "System.ComponentModel.DataAnnotations" Will be continued.....
@rajendranan41547 жыл бұрын
Hi venkat, In employee model class if I not specify [Key] on top of the properties declaration getting exception after adding [Key] attribute working as expected.. could you please tell me what is the use of adding [key] attribute???
@b0sStAB9 жыл бұрын
I am having this message -- An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code Additional information: The underlying provider failed on Open. The problem points here: Employee employee = employeeContext.Employees.Single(emp => emp.EmployeeID == id); -- Changed my connection string as suggested in the comments here but still unable to open database. All my connections are OK though. I have no idea where the problem is coming from.
@b0sStAB9 жыл бұрын
b0sStAB I found the problem already. Followed this - stackoverflow.com/questions/24822076/sql-server-login-error-login-failed-for-user-nt-authority-system
@naveenk369 жыл бұрын
b0sStAB No joy at all, spending lot of time but could not get pass through...
@andrewshults64456 жыл бұрын
yeah I'm having the same problem. This is preventing me from even continuing the tutorial and its only lesson 8 -_-
@deepakchawla11128 жыл бұрын
I am Getting an exception"entitywasnothandledbyusercode" while runnning this code and message is "the underlying provider failed on open. " could you please advise me on this what can i do for getting output ? i done a same code as you have done in video...i am using visual studio 2012,sql sever management studio 2008,entity framework 6....may be this is not connected to database
@deepakchawla11128 жыл бұрын
Kindly Advise Sir
@MrZ12319868 жыл бұрын
Check your settings in connectionString He use connectionString="server=." your server could be diffrent name like server=DESKTOP-O25GLU5\SQLEXPRESS
@nasimk36808 жыл бұрын
Thanks Bro. Finally I solved my problem by entering correct SERVER name (PC_Name\ServerName). THANKS.
@Csharp-video-tutorialsBlogspot11 жыл бұрын
Nope, users doesn't need to enter ID in the URL. When we click on the delete button the ID gets passed. This is discussed in the subsequent videos in the MVC tutorial. Hope you will find them useful.
@brenosantin97397 жыл бұрын
Hail from Brazil, thanks for the class.
@sprakash109410 жыл бұрын
Go to your IIS then double click on Application Pool then on right hand side click on Set Application Pool Defaults after that in Process Model , Select Identity = local system.. its working for me . Thanks
@gururajjoshi151610 жыл бұрын
Thanks for responding, but result is an error showing "Keyword not supported: 'v11.0; attachdbfilename'"
@al1980ful9 жыл бұрын
sprakash1094 thanks friend, that's it...
@jgarciascr56 жыл бұрын
"The name of this connection string matches the name of our class EmployeeContext" ( 5:25 ) Does it mean we should have as many connection strings as context classes the application has? That does not sound very practical to me. If not, how can the different classes use one common connection string that lies within the web.config file?
@jgarciascr56 жыл бұрын
The solution is to specify the connection string name in the context class constructor method: public YourContext() : base("name = YourConnectionName") { }
@AcheiversOfficial3 жыл бұрын
@@jgarciascr5 thanks for the question and answer.
@indranilpaul39458 жыл бұрын
"The property 'DeptId' cannot be configured as a navigation property. The property must be a valid entity type and the property should have a non-abstract getter and setter. For collection properties the type must implement ICollection where T is a valid entity type."
@AzizjanAyupov_leo7 жыл бұрын
Thank you very much!!! It was exactly what I was needed!
@kushagrakhandelwal88673 жыл бұрын
Hi Venkat , I have a question, If we have multiple module classes then every time do we have to add the specific connection string in web config file? Can't we do that thing manually or isn't don net have something which automate that. Can you please make videos on newer concept too. So we can be up-to-date with newer concepts. There is no doubt your videos are awesome and no one can teach us like you do.
@saranshkumar84798 жыл бұрын
venkat sir, u rock yaar :)
@lbhatt7 жыл бұрын
Hi Venkat, After all, i am getting below error. could you please advice! An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code Additional information: The underlying provider failed on Open.
@muhammadshaheer16485 жыл бұрын
I've a doubt, in the controller section why don't you pass employeecontext object in return view() paranthesis in order to rendering html view?
@ArifHussain-sq5fh6 жыл бұрын
Thanks sir very helpful for beginners God give u long life
@EnKamran11 жыл бұрын
do i need to set : Database.SetInitializer(null) when i'm using Entity framework 6? i mean if i dont use this is it possible to delete my old data in my database?
@EnKamran11 жыл бұрын
i forgot to say i am using code first and my database creates runtime.
@evanflink707310 жыл бұрын
En Kamran Hi - no you do not add that line if you are using Code First. You only need it if you are using Database First (that is, you don't want your database to be created by EF) ,
@hetallcc8 жыл бұрын
Hi Venkat, I love the way you teach and for anything new i want to learn i always follow your series. its much better and the way you explain things is so clear and easy to understand. i have been following this successfully but now with this part 8 i am stuck and can;t go ahead. I am using visual studio 2013. and i have got error like Additional information: The underlying provider failed on Open. I have following exctlly what you are saying but just stuck here. do you have an idea what is this regarding and how can i fix it. Thanks kind Regards Hetal
@ypcingchikara8 жыл бұрын
+Hetal Patel It's related to the sql server provider, please add the following attribute and value to your connectionstring and it should work. network library=dbnmpntw; let us know in case you are still having problem.
@SouravBhattacharyaITFaculty9 жыл бұрын
I use sql server 2008 express, so I used .\SQLEXPRESS instead of . in the connection string and it worked for me, long live kudvenkat sir
@sagishorts27858 жыл бұрын
hi, iam not clear with the Connection string part, how did you add it?
@SydurRahman218 жыл бұрын
Hi kawshik sagi, I'm also agree with you. It is really confusing part. I'm still trying to do this part with my own but getting error!!!
@sagishorts27858 жыл бұрын
Yes bro we need to find an answer or venkat need to tell???
@bhuwanpandey43428 жыл бұрын
@Kaushik Sagi Just in case you still have doubt Its exactly the same we do for a normal web application, we are just adding a sql server connection string to the ConnectionStrings section of the web.config Go to server explorer(ctrl+W, L or View -> Server Explorer) and connect to your database, once connected right click and select properties there you will find the Connection property something like "Data Source=DELL\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated Security=True", just copy this and put it there in the connectionstring section of the config file, also keep the connectionstring name same as your Model class(EmployeeContext in the video). Hope this helps!!
@egl20048 жыл бұрын
Thank you SO much! This was extremely helpful and solved the problem. I really appreciate it!
@secretlives27348 жыл бұрын
can u guys tell me after connecting my database by adding connection string through server explorer it gives me error "an exception of type system .data.entity exception occurred in entity framework.sqlserver.dll bt not handled in user code. plz help me frnds "
@female1file9 жыл бұрын
SOLUTION: for anyone have this problem # EntityType 'Employee' has no key defined. Define the key for this EntityType# just add in employee class this word [Key] before EmployeeId property and add this also using System.ComponentModel.DataAnnotations;
@ashrafnazir7018 жыл бұрын
Thanks a lot i got rid of this error :-)
@ayxanesedullayev37094 жыл бұрын
wouw it worked thanks a lot i searched this error approximetely 4 hours)
@librairum23664 жыл бұрын
Thanks for this solution fro my error about Entity error.
@kartheeknagulapati3488 жыл бұрын
Folks who ever have a trouble creating a connection string with the DB in SQL Server Express, follow these steps: 1. First create a DB named Sample in SQL Server express 2. Add the necessary table named tblTable and data into it 3. Go to web.config file inside your visual studio MVC demo project 4. Open a connection string tag, and paste the below code into it: 5. Refresh the server explorer. 6. Your DB is connected.!! Thank you
@sureshmaddela41568 жыл бұрын
hello venkat please solve this problem. An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code Additional information: The connection string 'EmployeeContext' in the application's configuration file does not contain the required providerName attribute."
@chetanchaudhari14086 жыл бұрын
Had your problem is solved? plese tell me he solution
@chetanchaudhari14086 жыл бұрын
[Table("UserProfile")] public class Employee { [Key] public int UserId { get; set; } public string UserName { get; set; } public string Password { get; set; } public bool IsActive { get; set; } } Add [Key ] Annotations like above ...Its works.
@lizravenwood53178 жыл бұрын
Dang you are a good teacher. So I am wanting to have a full grid view with CRUD operations that maps to a database. I want to be able to use datasets for looping and such, so I think I need the entity framework. Is it possible to do both? Oh - and another complication is that the database is not sql server but an Access table.
@dsingh320511 жыл бұрын
Thank you sir for the 8th part of MVC. Have a great day.
@AndrewErwin7311 жыл бұрын
I have a question. It is my understanding of MVC that the model is not necessarily the data layer, but the business layer. My basic process is to create a whole separate project within my solution (even an MVC solution) for the datalayer. What do you suggest is the most efficient way to handle the "separation of concerns) when developing against MVC? I like the approach you take in this video, but it seems to go against my instinct. Thanks a lot for the videos! I do find them extremely helpful.
@sanaravi78 жыл бұрын
Hi Venkat Garu, I have some doubt. we are using SetInitializer function for already existing table in sample database. I try to using me created database it will showing SetInitializer throw exception. I tried using 'EmployeeContext.(null);" it will also get error. plz give me solution for this.
@lavanya42474 жыл бұрын
hi , when Context class is add automatically connection string will form or we have to add connection externally
@SaptarshiRoy054 жыл бұрын
We need to add externally
@girishdagdiya755510 жыл бұрын
If you cannot find EntityFramework in references folder as shown in above video, then go to Tools> Library Package Manager> Package Manager Console and write "Install-Package EntityFramework -Version 5.0.0" , without double quotes. You will see Entity Framework in References folder now. :)
@viewsbyme10 жыл бұрын
you are a champion!! thanks for the tip!!
@MrIrrepressible10 жыл бұрын
nice one!!!
@shyammohanRaman9 жыл бұрын
thanks!
@saikhasim64986 жыл бұрын
thanq bro for this i searched 2 hours on web very useful..thanks bro
@fitkundan928 жыл бұрын
While trying to access data as shown in this video I am getting following exception "An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code" And I am not able to connect the database . Suggest something in this regard
@yazoo1788 жыл бұрын
I'm completely overwhelmed. I already have a connection string in my web config called DefaultConnection. Of course if I change this to EmployeeContext it will break stuff. Do I need to add another one? I'm confused towards why something abstract like a connection string would have such a strong coupling to something which specific deals with employees.
@raviranjan29012 жыл бұрын
Dear Venkat, I'm using visual studio 2019 and sql server 2017 doing same process as in your video to fetch data from database, but i have some issue to execute. Login failed for user 'IIS APPPOOL\DefaultAppPool'. What does it mean
@kranthyreddy10238 жыл бұрын
The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Index(Int32)' in 'MvcApplication2.Controllers.employeeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters Im getting this error when i run the program can u please help me out
@tara2010p8 жыл бұрын
make sure that '1' in address bar .../Employee/Details/1
@sandeep__gosavi6 жыл бұрын
A very useful video. Thanks buddy.
@mazdysoraya612110 жыл бұрын
For those who get Error regarding SQL Connection. Within in web.config file, instead of using connectionString="data source=.; use Explicitly instance of your SQL server. connectionString="data source=computerName\sqlexpress; This error can occur if you for example have more then one instance of SQL ( like me ) so VIsual studio got confuse which to use. Hope this will solve problem for someone. I followed example exactly now it is working.
@TheNinjai7411 жыл бұрын
Hello Mr. Venkat! Great tutroial. I have added the the EntityFramework in Reference, but I notice in your WebConfig file there is a tag for 'EntityFramework' with a tag for 'defaultConnectionfactory type=""'. I'm not seeing this in my Webconig file. I'm currently using VS2013 Express. Thank you very much and great tutorials!
@rishikmani9 жыл бұрын
Hi Venkat, when I am trying to inherit DbContext class it shows error. Even though I have included the namespace System.Data.Entity. I have verified that under the references section, the System.Data.Entity and System.Data.Entity.Design are included as well. Could you please help?
@rishikmani9 жыл бұрын
Rishik Mani Tripathi Thank you... I solved it... I had to install the package through package manager console as well, it was only then I could inherit from DbContext. If anyone of you faces this issue, open package manager console from Tools, then type PM> Install-Package EntityFramework -Version 5.0.0
@nagarajjeela97315 жыл бұрын
when I enter DbContext and DbSet ,I am not getting add using System.Data.Entity namespace in intellisense of vistal studio. How to fix this problem?
@alamgirkhan83345 жыл бұрын
Dear bro. .First you need to install entity framework on your visual studio
@alamgirkhan83345 жыл бұрын
For version 2017: Click 'Tools' Select 'NuGet Package Manager' press 'Manage NuGet Package Manage for solution..' Now in (NuGet Package Manage for solution) you have to click 'browse' then search Entity Framework Check project and install......
@naveenkumar-bz3rg9 жыл бұрын
hi venkat, i got this error. The connection string 'EmployeeContext' in the application's configuration file does not contain the required providerName attribute." my con-string can you please resolve this , Thanks in advance.
@rajeshpradhan239 жыл бұрын
You forgot to close connectionstring with " and start providerName with ". thats why u r getting error. Its should be
@hrvaticaigitara9 жыл бұрын
Rajesh Pradhan Can you please tell me what is wrong with that?? I get the same error with the providerName
@ankittrivedi28618 жыл бұрын
Venkat Sir i m facing an 500 Internal Server Error. Please help me with it. can't find the solution to it. i have checked every thing every single line of code but still it is showing that error. And i wanted to ask what do u me by a sample database do we have to create a new database over take a built in db frm SQL server? i m confused in tht part also.
@anjanigarg17938 жыл бұрын
I was getting the same error message as everyone else were getting. Solution: I deleted the existing web.config file. (Make sure you save a copy of it in Notepad.) Run the program. New web.config file created. Got a different error. Checked what extra code was present in old web.config file and not present in new web.config file. Copied them to new web.config file. Run the program again. Worked. Hope this is helpful :)
@brunothebeagleofficial8 жыл бұрын
Anjani Garg i am getting the same error, did you find any solution
@daalwada5 жыл бұрын
Sometimes while Mapping in Employee class, it may throw an error saying "There is no Key defined in the class 'YourClassName'. Simple solution to it is to add a [Key] attribute with its namespace 'System.ComponentModel.DataAnnotations'
@eddiegere9 жыл бұрын
so many steps. lol. Very informative video on ASP.NET MVC. Thank you!
@quangdu1206198811 жыл бұрын
Hi Kudvenkat, I created a new project with the default template because I would like to re-use the built-in authentication function. But after I create a new EmployeeContext and change the name in ConnectionString in Web.config to EmployeeContext (original one is DefaultConnection), all the feature relates to authentication don't work anymore. When I revert it back to DefaultConnection, it works fine but cannot see the employee details. Is there any way to merge the contexts into one or how to change the connection string to make those functions can work together ? I really appreciate your contribution, your video helps me alot.
@quangdu1206198811 жыл бұрын
I found the answer myself, I am using MVC5 and if you go to IdentityModels.cs and change class ApplicationDbContext, it will work: public ApplicationDbContext() : base("YourContext") { } So happy :)
@Alii00078 жыл бұрын
Very Very good tutorial. Thanks +kudvenkat. I am having an exception after doing all above, "Underlying Provider failed to open". Why DB is not opening?
@bharathk65964 жыл бұрын
Same error showing pls share the solve method sir...
@Csharp-video-tutorialsBlogspot11 жыл бұрын
3. Re-add the reference for the same assembly, from C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages\EntityFramework.5.0.0\lib et40 Please Note: If you can't find the assembly at the above path, please use windows search feature to search for it. Still no success: Install Entity Framework 5.0 using NuGet Package Manager. Hope this solves the issue you have. Good Luck. Again, sorry for not answering in time.
@prakashkolluru11 жыл бұрын
Respected Sir, Im one of the Great fan of Ur's plz..! try to put some small projects which are helpful to develop any projects with respective Asp.net, Asp.Net MVC applications etc..! plz.. Give reply as soon as possible..!
@adilrasheed64418 жыл бұрын
+Venkat you are doing a great job!! Could you please upload some knockout js using MVC 5 as well.
@argelpamintuango19568 жыл бұрын
what visual studio version are you using? because some of the tutorials that i follow on you is different and i am having a hard time fixing things.
@HemaRajamani11 жыл бұрын
kudvenkat, thanks for posting these videos, has been very helpful for me. About part 8 in particular, I kept getting 'IIS APPPOOL\ASP.NET v4.0' login error. I overcame that by adding this login to the security tab of Sql Server Management studio with windows authentication.
@ahmmady16 жыл бұрын
dear mr Vanket i have a problem the single method it gives me a message Sequence contains more than one element what should i do ? any suggest
@akshaysoren54006 жыл бұрын
i am getting this error at linq query: need help An exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll but was not handled in user code Additional information: An error occurred while executing the command definition. See the inner exception for details.
@bharathk65964 жыл бұрын
I am also same error sir pls share solve the method sir
@pravallikaannangi89408 жыл бұрын
Hi Venkat, I just followed your steps and got this error.. Can u please let me know the cause of this error. The context cannot be used while the model is being created. This exception may be thrown if the context is used inside the OnModelCreating method or if the same context instance is accessed by multiple threads concurrently. Note that instance members of DbContext and related classes are not guaranteed to be thread safe. thank you!
@jeffersonalexandermosetonq45537 жыл бұрын
Venkat, if i need use stored procedures from SQL Server how can i mapp it ?
@bhanumathi28417 жыл бұрын
Hi Sir. Please let me know, if it is mandatory to have primary key while working with models
@deepakthapa95288 жыл бұрын
i solved my problem.. we need to select visual studio development server instead of local iis server.
@VihaanKoul7 жыл бұрын
Yes this is correct.
@markorazumenic69157 жыл бұрын
thanks!!!!!
@jashjasani50456 жыл бұрын
My vs doesn't have visual studio development server, what should i do?? any help accepteed..
@karthikrajakumar8937 жыл бұрын
I'm getting the error while i run the application in Asp.net MVC5 "Cannot attach the file mdf as database". Can i follow this tutorial for developing an Asp.net MVC project in visual studio 2015.
@HackbalLearning4 жыл бұрын
Visual Studio 2019 Community Edition kzbin.info/aero/PLfqaeumOCiRlm9UDBc0pBcKLCW2phN1Ie
@ganeshkamath897 жыл бұрын
is there no other way than to re-start some other ASP.net tutorial, if i have MySQL Db instead of MSSQL DB?
@nathanzhou892111 жыл бұрын
Another question is, does the fields' name of a table in database should match entity model class's fields' name? How does entity framework know mapping those fields to right columns in database? Thank you very much.
@yusufmohamedsalh83217 жыл бұрын
for any one will have an error after watching this video : check out @Antony Khomeriki comment 1- at models ->Emolyee.cs,add below lines (to set EmpID as primary key) using System.ComponentModel.DataAnnotations; [Key] public int EmpID { set; get; } 2-adjust connection string at Web.config ,note you can get full server name from sql studio ,your table name ,r.click ,properties ,server = full name 3- type the word Id as a parameter not any other variable and remmber to type it on the url ie : Employee/Details/1. public ActionResult Details(int id ) { EmpContext empcontext = new EmpContext(); Employee employee = empcontext.Get_All.Single(emp => emp.EmpID== id); return View(employee); 4- extra note , preferable to type the class members as the table members name.
@harikaaakutota777611 жыл бұрын
hi venkat, here manually id =1 is entered in the url to retrieve a particular employee record.but in real time how does end user retrieves particular employee record?does he too enter id=1 in the url ?pls clarify this doubt...
@NazmulBilashHossain9 жыл бұрын
I have facing problem in Employee employee = employeeContext.Employees.Single(x =] x.EmployeeId == id); I got error. What wll I do ? Please help me.
@rajeshpradhan239 жыл бұрын
what error u r getting?
@jonsek52039 жыл бұрын
Rajesh Pradhan Hi i´m having the same issue!?Hope this helps! :) "The parameter dictionary contains a null entry for parameter 'id' of non nullable type 'System.Web.Mvc.ActionResult Details(int32) in .Controllers.EmployeeController. An omptional parameter must be a reference type, a nullable type or be delared as an optional parameter. Parametername: parameters"
@rishikmani9 жыл бұрын
Nazmul Hossain did you find a solution. I am also having the error at same line of code and am not able to start SQL Server Agent.
@575saikrishna9 жыл бұрын
Nazmul Hossain i got the same error !!! i figured it out .... we need to give the same name EmployeeId in sql server ..it works fine for me
@priyaselvaraj13443 жыл бұрын
Hi Venkat, I'm using VS 2019 right now, unable to follow your first step because, I couldn't download entity framework from NuGet package manager, please do reply. Thank you!
@v.dprasad2196 Жыл бұрын
Hello Venkat sir, iam trying this code but it gives error, sometimes is Login failed for user 'IIS APPPooL\DefaultAppPool' and sometimes is system.data.entity.core.entityexception, login failed for user sa, until now am not getting output, so kindly plz share how to add sql table in sql server object explorer or server explorer.
@PraneethHarpanahalliPraneethh9 жыл бұрын
I am getting the following error: "The context cannot be used while the model is being created. This exception may be thrown if the context is used inside the OnModelCreating method or if the same context instance is accessed by multiple threads concurrently. Note that instance members of DbContext and related classes are not guaranteed to be thread safe." at the line Employee fk = emptr.Employer.Single(emp => emp.empage == id); Can someone help me
@turgaygulmez69019 жыл бұрын
Praneeth Harpanahalli change your connection string as
@PraneethHarpanahalliPraneethh9 жыл бұрын
Thanks I figured it out
@prayash202 жыл бұрын
Hello Venkat Sir, I am trying to perform the same operation using the Employee class with different model name different to Employee model. All the properties are same. I am getting the error of missing type while running the Controller. Can you guide me on this????
@davidespada0111 жыл бұрын
Hi Mr.Venkat cant i use the ADO.NET like the asp.net forms, because EF a little bit Hard to understand
@abhishekchauhan7807 жыл бұрын
I got a error , please help me out ..!!! Error:An exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll but was not handled in user code Additional information: An error occurred while executing the command definition. See the inner exception for details. I browsed a lot but cann't even find single solution. Also , i add [Key] attribute in model but didn't run app. successfully
@ShivaRamaKrishnaG8 жыл бұрын
Really helpful and very nice explanation
@mohitetv53804 жыл бұрын
I am using VS 2015. I got this error : An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code . Please comment
@sameersk18 жыл бұрын
Simply Great!!
@gururajjoshi151610 жыл бұрын
Hi, i have done exact things which are shown in video, by adding some changes like Key attribute in model class, i had one more error "The underlying provider failed on Open", so i have added in EmployeeController class as public ActionResult Details(int id) { empolyeeContext empcon = new empolyeeContext(); empcon.Database.Connection.Open(); Employee empl= empcon.employees.Single(emp => emp.EmpId == id); But it started showing other error: Cannot attach the file 'D:\Working folder\MVCexamplePro\MvcDemo2\MvcDemo2\App_Data\MvcDemo2.Models.empolyeeContext.mdf' as database 'MvcDemo2.Models.empolyeeContext'. before staring this example i have created a DB in SQL Server 2008R2, with a small table wit columns as id,name,gender and city need help resolve this error
@sinraj000711 жыл бұрын
I am u r big fan ,U make dot net easy to understand.Can u upload Ajax video tutorial