tag:blogger.com,1999:blog-6082652835152798567.post3783540452880143680..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Part 3 - Entity Framework Code First ApproachUnknownnoreply@blogger.comBlogger17125tag:blogger.com,1999:blog-6082652835152798567.post-84551344916171071222020-11-17T14:58:17.145-08:002020-11-17T14:58:17.145-08:00for those who can not find EmployeeRepository, ple...for those who can not find EmployeeRepository, please add <br />using system.data.entity in classes EmployeeRepository and EmployeeDBContextAnonymoushttps://www.blogger.com/profile/13475646156506138582noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-23253218070118004072020-11-17T11:50:13.128-08:002020-11-17T11:50:13.128-08:00i got this error -> CREATE DATABASE permission ...i got this error -> CREATE DATABASE permission denied in database 'master'.Anonymoushttps://www.blogger.com/profile/13475646156506138582noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-41615333937619652622020-04-07T12:01:52.646-07:002020-04-07T12:01:52.646-07:00An explicit value for the identity column in table...An explicit value for the identity column in table 'Employees' can only be specified when a column list is used and IDENTITY_INSERT is ON.<br /> i am getting this error sir<br />Anonymoushttps://www.blogger.com/profile/13589087730692668336noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-128150246313741762019-12-07T14:41:47.332-08:002019-12-07T14:41:47.332-08:00You have done a very good video here - much better...You have done a very good video here - much better than Microsoft documentation! Very helpful, sir! A couple of questions:<br /><br />1) In your EmployeeRepository class, you have the GetDepartments() method, where the first line is: EmployeeDBContext employeeDBContext = new EmployeeDBContext(); This means that the context in created new on each call. Isn't this bad for performance? Would it not be better to show employeeDBContext as an instance variable of the class, set when the EmployeeRepository class is created and destroyed when the class is destroyed?<br /><br />2) You show connection string in the web.config file. It does not indicate the physical location of the database; it simply uses the default '.'... This doesn't seem like something a real-world app would do. Isn't there some way to determine the location and set the connection string at run time? What connection string would you use to specify that the database should be created in C:\Users\UserName\Documents\ (where UserName is different for each installation of the app)?Anonymoushttps://www.blogger.com/profile/05388476199009959448noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-33482710161910579242019-03-08T03:07:41.910-08:002019-03-08T03:07:41.910-08:00using System.ComponentModel.DataAnnotations.Schema...using System.ComponentModel.DataAnnotations.Schema;<br /><br />namespace ConsoleEntityFramework.Models<br />{<br /> public class Employee<br /> {<br /> public int Id { get; set; }<br /> public string FirstName { get; set; }<br /> public string LastName { get; set; }<br /> public string Gender { get; set; }<br /> public int Salary { get; set; }<br /> public int DepartmentId { get; set; }<br /> [ForeignKey("DepartmentId")]<br /> public Department Department { get; set; }<br /> }<br />}<br />NISHANK JAINhttps://www.blogger.com/profile/16332148089285572277noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-56959841194872480302018-06-23T01:48:46.393-07:002018-06-23T01:48:46.393-07:00Hi Guys....
Those who are not getting the Busin...Hi Guys....<br /><br /> Those who are not getting the Business Object(EmployeeRepository) to configure the DataSource(ObjectDataSource), Just go and check where you have placed the connectionStrings element in the web.config file.<br />According to asp.net runtime the element if present within the web.config file then it must be the first child of the root configuration element.<br /><br />so put your element anywhere after the element. And then build and try to find it in the <br />Business Objects List...Anonymoushttps://www.blogger.com/profile/02877569142188924038noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-82777281812641434342017-09-17T01:57:30.773-07:002017-09-17T01:57:30.773-07:00Hi Venkat,
I am getting below Error in EmployeeRep...Hi Venkat,<br />I am getting below Error in EmployeeRepository Class<br /><br />The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.<br /><br />Please let me know what could be the issue.. I have tried but not able to fix.Amit Gaikihttps://www.blogger.com/profile/05138258218581913123noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-11093235732599589622017-08-08T06:42:49.757-07:002017-08-08T06:42:49.757-07:00I have been trying to get this step to work and ke...I have been trying to get this step to work and keep failing. I completed all the steps and the code matches, but when I run the program all I get is the "My ASP.NET Application" splash page. Also, the database structure does not get created. I had no issues with videos 1 and 2.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-16629253958818052432016-11-11T12:06:16.478-08:002016-11-11T12:06:16.478-08:00Dear Venkat ,
I'm very happy in this course an...Dear Venkat ,<br />I'm very happy in this course and thank you for that.and I need your help>i have error (Both DataSource and DataSourceID are defined on 'GridView2'. Remove one definition).Anonymoushttps://www.blogger.com/profile/17733740478427415334noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-20290230423214551832016-08-23T23:00:50.062-07:002016-08-23T23:00:50.062-07:00Rebuild once and tryRebuild once and tryAnonymoushttps://www.blogger.com/profile/05606563446461218078noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-13130878177595549732016-06-18T20:03:54.231-07:002016-06-18T20:03:54.231-07:00Hey class should be publicHey class should be publicTEJA_1122https://www.blogger.com/profile/13520814714030454754noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-52375078276782602662015-10-14T03:54:31.139-07:002015-10-14T03:54:31.139-07:00I am using VS2012, so far it's working good bu...I am using VS2012, so far it's working good but in ObjectDataSource1 I am unable to find EmployeeRepository business object not sure why ?? Plz give any suggestion to solve my problem.. ThxAnonymoushttps://www.blogger.com/profile/06908956853143276734noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-45527689982403614432015-06-07T09:40:04.354-07:002015-06-07T09:40:04.354-07:00Have problem with null values in code approach to ...Have problem with null values in code approach to database mapping, if the vaule in column is null in database i have problem to fill datagrid, can u give solution?<br /><br />thxAnonymoushttps://www.blogger.com/profile/01419320798296164305noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-49395203418059913392014-12-11T23:17:27.152-08:002014-12-11T23:17:27.152-08:00respected sir,
i am new to both development and de...respected sir,<br />i am new to both development and deployment .<br />i have developed a simple mvc5 application which is using entity framework to access the database.<br />it was working fine in my localhost . <br />i have published the application in godaddy .<br />now the app in godaddy is allowing me to insert the data into database but when i am trying to retrieve the data i am getting error . <br /><br />my connection string in web.config is as follows <br /><br /><br /><br />the error message is as follows<br /><br />The connection string 'DBContext' in the application's configuration file does not contain the required providerName attribute."<br /><br />please guide me through .<br />my mail id is mulladitya@gmail.comadityahttps://www.blogger.com/profile/08501981058691323275noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-46181150459816164642014-10-24T22:11:37.056-07:002014-10-24T22:11:37.056-07:00sir I am facing an Exception in repository class ...sir I am facing an Exception in repository class as"<br /><br />An exception of type 'System.Data.Entity.ModelConfiguration.ModelValidationException' occurred in EntityFramework.dll but was not handled in user code<br /><br />Additional information: One or more validation errors were detected during model generation:<br /><br /><br /><br />CodeFirstApproach_EFDemo.Departments: : EntityType 'Departments' has no key defined. Define the key for this EntityType.<br /><br />department: EntityType: EntitySet 'department' is based on type 'Departments' that has no keys defined.<br /> Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-61438530824928249352014-06-04T04:23:38.889-07:002014-06-04T04:23:38.889-07:00Hi
I am not getting the EntityRepository.cs fill ...Hi<br />I am not getting the EntityRepository.cs fill what do sir<br />i have done all things correct<br />Anonymoushttps://www.blogger.com/profile/00448643337407654799noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-38049106668266481792014-05-07T10:09:41.237-07:002014-05-07T10:09:41.237-07:00Venkat Sir,
Would you please discuss how to call S...Venkat Sir,<br />Would you please discuss how to call Stored Procedures when we use Code First Approach or Model First Approach ?<br />And Would you please discuss Unit Of Work in Repository Pattern?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/03379274077098764027noreply@blogger.com