Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Browsing all 1698 articles
Browse latest View live

Child tables lookup is not loading using Lazy loading

Hi,I have a primary table and secondary table lookup where i will load secondary drop down values based on primary drop down selection. But secondary drop down is not loading when i am using lazy...

View Article


Get all records help

HiI have a field in a table  which is simply for sorting and say I want to select all from "e" to "w", how do i do it?

View Article


Why did the validation controls stop working?

Hello,Why did the validation controls stop working after the data source of GridView was changed to Entity Framework from SqlDataSource on a Web form which has double master pages? The combination...

View Article

query syntax needed

Hi,May I know what is the LINQ query syntax for this below?Location obj = ne.Locations.First(x => x.LocationID == LocationID);

View Article

FK Column error - MVC Core 2 - SqlException: Invalid column name...

hi guys, I have two simple classes with a Primary Key and FK relationship.In the Sub_Department class, I get the error> SqlException: Invalid column name 'DepartmentID1'....

View Article


Image may be NSFW.
Clik here to view.

How to select random id from database and display randomly on label

Currently, I'm working on the Lucky Draw system. So the process of the system is when user click on button draw it select a random id from database where table attendance="Present". I also want to make...

View Article

Cannot insert data into database

I'm working on registration page that user will fill the form and sumbit into database. I got the problem with database. Can anyone shared with me idea/solution. Thanks.using System; using...

View Article

help understanding EF , Transactions and Unit of Work

I am trying to understand transactions a little more, but I don't know how to test them, eg two people accessing the same records at the same time,so i have no realpractisein how they work.Now i use a...

View Article


inserting directory structure into SQL

Im trying to insert a directory and its subdirectories into SQL , its working great but i cant figure out how to insert the filenames of the files inside the subdirectory...below is my complete...

View Article


Issue saving single quotes to database

I'm using .net 4.0 to insert textbox values into a sql database.  Whenever I try to insert single quotes into the database, the values are appearing as &#39.  How do I save single quotes to the...

View Article

How to set index with one line of LINQ?

I need to get the inner text and then what index it is in the list.Is there a way to do this inline without me having to foreach over the list and setting it? var teamNameOrder =...

View Article

How to convert the below to Async Call

How would I convert this to an ASYNC call?publicclassFoo{publicintId{ get;set;}publicint?ParentId{ get;set;}// other props}You can get children of one item...

View Article

Entity Not Updating in Database

I am following a pattern in an MVC controller to avoid overposting while updating a record. I have left certain fields out of the View because I don't want the user to update these fields. I then want...

View Article


Entity Framework Exception error 1004, NullSentinelProperty mismatch on output?

Hi guys, Can someone take a look at the following example posted in StackOverflow almost an year ago.I having the same problem.StackOverflow questionThanks!

View Article

One to many relationship without foreign key

I've problem with mapping ralations, which there is in existing database. Two tables: table1 and table2table1 has fields: table1Id, table1Code, table1Field (table1Id is primary key)table2 has fields:...

View Article


EF Code first and stored procedures

Hi,I have started to develop a system where it is based on EF Code first. I have now a new requirement for complex reports that were developed using Stored Procedures. Since this is a code first...

View Article

Only exception handling in controller?

This is probably a question that has been done many times, but i find myself doing this some times:I wonder if it is right to double exception handling where if I create a post in a database from the...

View Article


Static Variables

As static variables are static for the whole web application, is it dangerous to declare sql specific variables as static :public static class Database {public static SqlConnection Sql_Connection;...

View Article

Microsoft.EntityFrameworkCore.InMemory updates Attach entities

Hi,I start to use Microsoft.EntityFrameworkCore.InMemory for testing purpose (with xunit and moq).During my tests, I "discovered" that Microsoft.EntityFrameworkCore.InMemory update entities, even when...

View Article

Disconnected scenario during tests with Microsoft.EntityFrameworkCore.InMemory

Hi,I want to test the EditPost method of controllers. To simulate database access, I use Microsoft.EntityFrameworkCore.InMemory.But if I use Microsoft.EntityFrameworkCore.InMemory, I have to do...

View Article
Browsing all 1698 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>