Part 8  Data access in mvc using entity framework

Part 8 Data access in mvc using entity framework

kudvenkat

11 лет назад

943,771 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Hey Prachi
Hey Prachi - 16.07.2023 18:47

Keyword not supported: 'intergrated security'.


I did all as per above video but get this error anyone can give me solution why get this issue

Ответить
Rajesh Arekallu
Rajesh Arekallu - 18.04.2023 11:31

Please explain in detail 3rd step sir web.config

Ответить
Rajesh Arekallu
Rajesh Arekallu - 18.04.2023 11:02

Sir pls share where is tha windows authentication

Ответить
Umar Daraz Officials
Umar Daraz Officials - 14.04.2023 18:31

i dont know why my project is not showing any result

Ответить
Gustavo Daniel Palma Estrada
Gustavo Daniel Palma Estrada - 07.09.2022 08:12

If someone is struggling with SQL connection try this:

<add name="EmployeeContext" connectionString="server=.\SQLEXPRESS; database=Sample; Integrated Security=SSPI" providerName="System.Data.SqlClient"/>

Ответить
vinay saraswat
vinay saraswat - 27.08.2022 16:26

Unable to find the requested .Net Framework Data Provider. It may not be installed.

sir i am getting this error.

Ответить
LIVE LIFE 🤩
LIVE LIFE 🤩 - 13.06.2022 08:05

Hi sir I have a doubt I am getting null reference exception data is not loading i have tried so many ways it's not solved can u help me on solving it

Ответить
K H A N ' s
K H A N ' s - 07.04.2022 03:16

Sir, you are a legend!

Ответить
Prayash Bhatt
Prayash Bhatt - 05.03.2022 12:47

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????

Ответить
Animesh Anand
Animesh Anand - 06.02.2022 14:49

Dear Venkat, In my last problem, when i change the DefaultAppPool to Local system the following error occurs in my program. "SqlException: Cannot open database "DemoEmployee" requested by the login. The login failed.
Login failed for user 'WORKGROUP\ANIMESH$'."

Ответить
Animesh Anand
Animesh Anand - 06.02.2022 14:44

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

Ответить
Priya Selvaraj
Priya Selvaraj - 29.12.2021 11:03

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!

Ответить
Kushagra Khandelwal
Kushagra Khandelwal - 10.10.2021 21:19

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.

Ответить
Adil Khawaja
Adil Khawaja - 12.09.2021 14:33

sir
==================The requested page cannot be accessed because the related configuration data for the page is invalid.

Ответить
Nashra Khan
Nashra Khan - 04.07.2021 17:26

Error Code
0x80070032

Config Error
The configuration section 'connectionString' cannot be read because it is missing a section declaration


please help

Ответить
Sujata Khandekar
Sujata Khandekar - 08.04.2021 10:01

getting error as "'An error occurred while executing the command definition. See the inner exception for details.'
" kindly help .
also I have checked db name and table name they are proper

Ответить
Sm Taha
Sm Taha - 06.04.2021 19:19

Cannot attach the file: FirstMVC.Models.EmployeeContext.mdf' as database 'FirstMVC.Models.EmployeeContext'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Need Help!!! I am searching for approx 2 days!

Ответить
sunithareddy kusu
sunithareddy kusu - 02.03.2021 14:41

public ActionResult Details(int id)
{
EmployeeContext employeeContext=new EmployeeContext();
Employee emplo
yee=employeeContext.Employees.Single(emp=>emp.Eno=id)//here i am getting error
return view(employee);
}
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.
PLEASE HELP ME.

Ответить
sankar M
sankar M - 17.02.2021 10:43

I executed this but it ask IIS APPPOOL how can I solve

Ответить
Edward Ciafardini
Edward Ciafardini - 28.12.2020 00:59

**in response to the many error complaints: you may be getting an error because you set your PK ID to varchar instead of int in SQL---this happened to me and I had to delete and recreate the table, then everything worked --- sorry if this doesn't help with your particular issue!

Ответить
Tamma T
Tamma T - 12.11.2020 16:08

if I have 1000 of Model context classes how I can mention 1000 connection strings in web.config

Ответить
Ahmed Elsokkary
Ahmed Elsokkary - 11.08.2020 05:44

i still have a problem connecting to the database

Ответить
pandavula shivasena
pandavula shivasena - 13.07.2020 10:21

Nice explanation sir

Ответить
Lavanya
Lavanya - 08.06.2020 15:56

hi , when Context class is add automatically connection string will form or we have to add connection externally

Ответить
Devendra Jadhav
Devendra Jadhav - 05.05.2020 13:06

System.Data.Entity.Core.EntityException: 'The underlying provider failed on Open.' i got this error sir please help ?

Ответить
vishal jaiswar
vishal jaiswar - 24.04.2020 09:43

SqlException: Cannot attach the file 'D:\project\Practies1\Practies1\App_Data\Practies1.Models.EmployeeContext.mdf' as database 'Practies1.Models.EmployeeContext'. I am getting this Error.

Ответить
Shirin Mirzi M K
Shirin Mirzi M K - 23.04.2020 15:29

great video

Ответить
Anu Bala
Anu Bala - 08.04.2020 01:41

in the last step, what will happen if no ID is passed

Ответить
Arvind Yadav
Arvind Yadav - 29.03.2020 13:14

Hi, I am learning MVC and facing the problem in connection to the Database, below is the error i am getting


Cannot open database "Sample" requested by the login. The login failed.
Login failed for user 'WORKGROUP\ARVIND$'.


My ConnectionString is


<connectionStrings>
<add name="EmployeeContext" connectionString="server=.; database = Sample; Integrated Security = SSPI" providerName="System.Data.SqlClient" />
</connectionStrings>


Can someone help me out.
TIA

Ответить
Lawrence Yoma
Lawrence Yoma - 28.02.2020 18:36

pls can you make a short video on how you made the database for this tutorial.. my own is not working pls

Ответить
РЕХМА
РЕХМА - 27.02.2020 04:21

Is it codefirst?

Ответить
V J
V J - 12.02.2020 19:43

Model validation exception
‘System.Data.Entity.ModelConfiguration.ModelValidationException’ occurred in EntityFrameWork.dll but was not handled by the user.

Did everything as in the video but getting the same error again and again. Any help could be really useful.. thanks in advance....

Ответить
Mohite TV
Mohite TV - 22.01.2020 05:08

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

Ответить
Muhammad Shaheer
Muhammad Shaheer - 26.12.2019 21:39

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?

Ответить
Vlad Vlad
Vlad Vlad - 24.11.2019 17:30

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 <3

Ответить
raveena mvc
raveena mvc - 22.11.2019 08:18

i created same as like you created, but i got this while running the code,please help me out.


Server Error in '/' Application.


EmployeeContext employeecontext = new EmployeeContext();
Line 18: Employee employee = employeecontext.Employees.Single(emp => emp.employeeid == id);

Ответить
Abanob Rashdan
Abanob Rashdan - 20.11.2019 12:23

thanks

Ответить
SAURABH KATROJWAR
SAURABH KATROJWAR - 16.11.2019 08:57

Good morning sir.
Subject: Entity framework is not installing.
Sir, I am using visual studio 2010. As sp1 is showing error,MVC4 is not installing.
Hence, I am using MVC3 and In MVC3, with the help of manage NuGet Package for solition.... Entity framework is not installing.
So what should I do sir.
Thank you.

Ответить
The guy
The guy - 11.11.2019 07:47

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'

Ответить
Ateeq Rehman
Ateeq Rehman - 05.11.2019 16:37

where is the tutorial for creating the database ?

Ответить
Devashish Bhatt
Devashish Bhatt - 04.11.2019 09:49

Please respond how to solve Connection string problem ????

Ответить
Kumar Bros
Kumar Bros - 30.10.2019 12:16

Sir I have tried this video and installed EntityFramework 5.0.0 on .NET4.5(MVC4), but on runtime getting an error as: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.

Ответить
Shailendra Tiwari
Shailendra Tiwari - 11.10.2019 05:23

sir sandar(best) video

Ответить
Muhammad Arslan Khan
Muhammad Arslan Khan - 30.09.2019 11:12

i face some issue installing after entity frameworks from nuget. (this project references nuget package(s) that are missing on this computer). i updated this package after this my project is not loaded in vs. i don't know why,
kindly help me out to solve this problem

Ответить
P A
P A - 20.09.2019 02:23

Hi,
I am facing below error, has anyone who faced similar issue/ have an idea how to fix it, could you please help. greatly appreciated.
System.Data.Entity.Core.EntityException: 'The underlying provider failed on Open.'

SqlException: Cannot attach the file 'C:\Dev\MVCDemo\App_Data\MVCDemo.Models.EmployeeContext.mdf' as database 'MVCDemo.Models.EmployeeContext'.

Ответить
Nagaraj Jeela
Nagaraj Jeela - 17.08.2019 17:12

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?

Ответить
javier jose
javier jose - 25.07.2019 07:26

why he did all this manual process instead of to use entity framework?

Ответить