I have a small project that will have 1 user on 1 computer. The database will be rather small (probably less than 1 mb of data). I plan to use WPF and Entity Framework for that project....I came up with 2 potential database solutions for my project : ...S...
I have recently upgraded to Visual Studio 2012 and SQL Server Management Studio 2012, however I cannot seem to see how to execute SQL scripts (created by Entity framework) on a SQL Server CE 4.0 database. With VS2010 + SSMS 2008 the Transact-SQL editor wo...
I have Visual Studio 2012 and I'm using the Entity Framework stack with EF 6. I did all correct but while adding migration I am getting the error . ...System.Data.Entity.Core.ProviderIncompatibleException...Here are the classes ...public class Order
{
...
I'm stuck on the following scenario.
I have a database with a table with customer data and a table where I put records for monitoring what is happening on our B2B site. ...The customer table is as follow:...ID, int, not null...GUID, uniqueidentfier, not ...
Is there a way to create an index in MS SQL Server database using Entity Framework Code First Migrations, if the index has to be:
...descending by at least one column...including other columns...?...It has to produce something like this:...CREATE NONCLUST...
Background...I'm writing an application which finds events within a certain radius of a zip code. You can think of this like ticketmaster, where you type in your zip code and all of the concerts in the radius of x show up....I have a database table which ...
I am trying to create FULL TEXT index using Entity Framework Migration by executing custom Sql....My migration class looks like this:...public partial class DocumentContentFullTextIndex : DbMigration
{
public override void Up()
{
AlterColu...
I have had a couple of suggestions on how to access data from my database:...var allMyIds
= context.Database.ExecuteSqlCommand("select id from AspNetUserLogins");
var allMyIds
= context.Database.SqlQuery<string>("select id from AspNetUserLogins")...
I want to make use SQL Server ...sequence... objects... in Entity Framework to show number sequence before save it into database. ...In current scenario I'm doing something related by increment by one in stored procedure (previous value stored in one tab...
BeginTransaction... method is used to manage transactions in Entity Framework 6. It allows to set isolation level for transaction as you may see in code below (just a sample):...using (var context = new DataContext())
{
using (var transaction = contex...
I am working on ASP.NET-MVC5 app and I have tables in which I need to insert null values in some of the attribute but I am getting null value exception error. I have 5 bit fields in this table which need to update invidually ...error...Model class...publi...
I am trying to build an ASP.NET MVC 5 Web Application in SQL Server 2015 Express using EntityFramework 6 but when I debug the application and go to a page where the database is needed I get the following error....System.Data.SqlClient.SqlException was unh...
I have a stored proc as below:...CREATE PROCEDURE [dbo].[MyProc]
@p1 as int,
@p2 as smalldatetime,
@p3 as int,
@p4 as varchar(255),
@p5 as int = null,
@p6 as numeric(18,2) = 0,
@p7 as char(2) = null
AS
...
...When I execute t...
I use entity framework 6 code first. ...At the moment I have a database for production.
I want to add a different database for tests. How do I do that? ...Do I need another connection string in my tests project? ...What should be the difference between t...
I have a conditional statement that evaluates an ....Any()... LINQ query against my DB....It is throwing an error when casting/converting a string to long value....(long.TryParse(m.Reference,out t)? t : long.MaxValue)
...The error is something like:...LIN...
I have a DB function requiring a table-valued parameter as argument (@c)....CREATE TABLE Test
(
CD varchar(10) not null
)
GO
INSERT INTO Test VALUES ('TEST')
GO
CREATE TYPE [CdTable] AS TABLE (CD varchar(10));
GO
CREATE FUNCTION TestTbl ( @x varcha...
I've implemented a simulated table inheritance construct in my SQL-Server based on the article ...Implementing Table Inheritance in SQL Server.... ...Besides the fact to use simple 1 to 0...1 relationships you create another constraint to a type table tha...
If I have a ...De-normalized... table like this :...FinanceList (NetSales,Expenses,Receivables,...etc,Discriminator)
...And I have another table (...PeriodType...) which i categorize the year according to two methods :...Quarter... (4 periods)...1-...Peri...
I need to perform a transaction like below:...Start transaction: Here I call ...context.Database.BeginTransaction()... (please note the ...context... here is not the same one below in the question where I want to read uncommitted)...Save a contact (done u...
I am working on an ASP.NET MVC 5 web application which uses Entity Framework version 6. ...Now I develop the application on SQL Server 2012 inside my development server. I mapped my database tables and I generate the ....edmx... model file. Everything is ...