Thursday 15 April 2010

asp.net mvc - C# Entity Framework SQL Error -



asp.net mvc - C# Entity Framework SQL Error -

i have emailhistorymodel :

public class emailhistory { public guid id { get; set; } public string companyid { get; set; } public guid? userid { get; set; } public datetime createddate { get; set; } public datetime sentdate { get; set; } public datetime updatedate { get; set; } public string outcome { get; set; } public datetime emaildelivereddate { get; set; } public datetime emailopened { get; set; } public string emailaddress { get; set; } public string htmlemail { get; set; } public string integrationdocumentid { get; set; } public rules rulesid { get; set; } public int transactionid { get; set; } }

i maintain getting error when trying access model. @ moment trying run next :

var emailhistorytotal = !emailhistory.any() ? 1 : emailhistory.count();

this keeps giving me error : "entityframework.dll not handled in user code

additional information: conversion failed when converting character string uniqueidentifier"

i'm not sure has changed working ok.....

if run next in sql, returns ok!?: select * [dbo].[emailhistory]

in sql columns set unique identifier id, rulesid_id , userid.

the emailhistory comming repository (see below method)

public iqueryable<emailhistory> getemailhistorybyuser(string userid) { homecoming _autosendcontext.emailhistory.asqueryable(); }

the _autosendcontext global variable interact db

any help or guidance great!

ok... nil email history table. error due info migrations, auto migration trying alter field in database nvarchar unique identifier.

this statement scheme trying run : alter table [dbo].[transactions] alter column [companyid] [uniqueidentifier] null

c# asp.net-mvc entity-framework

No comments:

Post a Comment