How to get distinct count of rows based on country code
see how data is stored in my data table.DateAmountCountryCode---------------------01/01/201710 GB02/01/201702 GB03/01/201705 GB01/01/201703 US02/01/201722 US03/01/201709 US04/01/201711 US01/01/201708...
View ArticleDropdownlist Boolean Yes No Text
Hi ,I have a sql table graduated data type bit. Also dropdownlist data source linq to sql. I want to be if dropdownlist text true text=Yes else text false text=No . DataClasses1DataContext test = new...
View ArticleHow to create Model
Hi I have properties like this . I want MemberId,RegId,SSN No to be Unique . I am using Entity Framework Code First Approach. MemberId will be Primary Key.I am using EF 5. In EF 6.1 i thibk Unique...
View ArticleNeed a work around pon this error
HI,I am working on a data entry application and while the operator is entering the data, the SQL connection terminates creating the following error. Please check the error belowTimeout expired. The...
View ArticleDrop Down List - Populate self and another field???
I am working on my first stand alone application after working through tutorials for months to get my head around this. I am working on what is called a condition report. As part of the condition...
View ArticleAudit Trail in Entity Framework 6.1.3?
Hi I am using generic repository pattern for CRUD operations. I want to audit trail when User modify record. I want to log modified property name, current value and new value. How to log this using EF...
View ArticleHow to fetch user information using Entity Framwork
Hi All,A ready made web application has been assigned to me by my TL. The application is based on entity framework for data manipulation.After removing some configuration error now It's working fine,...
View ArticleC# EF: date compare and no data is coming
i have a data in table and i am fetching data with date range and country code but no data is coming.when i am fetching data by sql query like below then right set of data is coming but when fetching...
View ArticleOrder by 4 columns query in EF with lambda
anyone can post what will be query in EF if i have order by clause for 4 columns.i got one with lambdavar qry = ctx.DestinationTimings.Where(x => x.DestinationID == this.ID) .OrderBy(t => t.Date...
View ArticleThe entity type 'UserRole' was not found. Ensure that the entity type has...
I have the following code to seed my UserRoles table:if (context.UserRoles.Any()) { return; } else //add user roles { var adminPersonID = context.Users.Where(u =>...
View ArticleForeign key tables not listed after adding Entity Data Model
I have various foreign key tables in the database. These tables contain the relationship between two other tables. For example the Job_Locations table holds the JobID which is the primary key of...
View ArticleInsert Statement Conflict on Foreign Key
First try of a site outside the safety of tutorials. I am getting this error:SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Equipments_Sites_SiteID". The conflict...
View ArticleFound Bug at System.Core.dll
.Net Framework 4.6 Sample CodeExpression left = Expression.Constant(value, typeof(DateTime)); Expression right = Expression.Constant(value2, typeof(DateTime)); //works corretly...
View ArticleCode first entity framework - One to many relationship
In my project, I have an Admin who adds instructors, then each instructor adds his students.Until now, I only created Instructor class : public class Instructor { public int InstructorID { get; set; }...
View ArticleBasic Search Not Working
I know I have some silly error in here. But I cant see it.I am adapting the search from a tutorial to work for me...but it isn't.Controller: public async Task<IActionResult> Index(string...
View ArticleIs EF Necessary?
Hi!I'm (finally) moving from WebForms to .Core.I'm using a current project from work as a test. This project is using a 3rd party SQL Server database. It's rather large and complicated, and when one...
View ArticleHow can I get the data falling between two selected strings?
HiI have data e.g. 000.DGDH.34H, 222.JJ8D ... 999.YDH77, A.383JD, B.HDJ738, D.J8829 ... Z.78WY8. I have to select the data that falls between the two strings. If the selected two strings are 000 and...
View ArticleHow to fetch details.
Hi All,Nowadays I am working on a web application to extend some features. Thsi web application is already developed by someone.Here I want to update the user profile. I already have a class name...
View ArticleHow to use sql transaction and commit code in ASP.Net C#
Hii have a query in which i used SQL Begin transaction and commit transaction.how to use this code in ASP.net C#.this particular action should be perform on button click.Regards,Jyotsna
View ArticleEF6 - unpredictable results with adding a table (epic time waster)
I have a SQL Compact db with about 40 tables or so, and an EF model.Two of those tables are A and B. I want to add a junction table AB.In the SQL Compact toolbox I delete the relationships between A...
View Article