SQL 2012 :: Entity Framework Returning Cached Data

Mar 23, 2014

I have a datagridview bound to a table that is part of an Entity Framework model. A user can edit data in the datagridview and save the changes back to SQL. But, there is a stored procedure that can also change the data, in SQL, not in the datagridview. When I try to "refresh" the datagridview the linq query always returned the older cached data. Here's the code that I have tried using to force EF to pull retrieve new data:

// now refresh the maintenance datagridview data source
using (var context = new spdwEntities())
{
var maintData =
from o in spdwContext.MR_EquipmentCheck
where o.ProdDate == editDate
orderby o.Caster, o.Strand
select o;
mnt_DGV.DataSource = maintData;
}

When I debug, I can see that the SQL table has the updated data in it, but when this snippet of code runs, maintData has the old data in it.

View 0 Replies


ADVERTISEMENT

Limit On Blob/image Data Type In SQL Compact 3.5 SP 1 BETA For ADO Entity Framework?

Apr 5, 2008

Hi! I tried to save some image data, but it get truncated at 8000 (the table column is defined as Image). I then wrote a converter to try ntext-datatype instead, but it gets truncated at 4000.


Error message:
System.Data.SqlServerCe: @3 : String truncation: max=4000, len=4168


The code uses only ADO entity framework for database access. Is there a way to store binary data larger than 8000 bytes? I am running SQL Compact 3.5 sp 1 BETA.


Henning



View 7 Replies View Related

SQL Server 2014 :: Entity Framework And Infinity

Feb 19, 2015

Working in a project using Entity Framework (Code First)...

Until now the project has been connected to a (generated) SQL Server Compact 4.0 database,

but now we want to connect to a SQL Server (at least 2008R2 since we will use FILESTREAM...)

Our problem right now is the possibility to enter Infinity values into REAL columns in the DB...

It works in the SQL Server Compact but we have not been able to get it to work in 2008R2 or 2014

The insertion of Infinity values is constructed by the Entity Framework (from using float.PositiveInfinity in C#) automatically so I mainly wonder if it at all is possible in a "real" database. Maybe there are some configurations possible to get it to work?

View 5 Replies View Related

SQL Server 2012 :: Exporting Data From MDS Entity To Database Table

Jul 30, 2014

How to export data from MDS 2012 entity to SQL 2012 user database table ?

View 6 Replies View Related

SQL 2012 :: Master Data Services Won't Migrate Delete Entity

Jul 24, 2015

I used "MDSModelDeploy deployclone" do deploy a package with EntityA, EntityB and EntityC to a production environment. I then deleted EntityB from my dev environment and used "MDSModelDeploy deployupdate" do update the model in prodution. After the deployUpdate, EntityB still exists in production. Is there something special I need to do (option of MDSModelDeploy?) in order for the deploy to delete an entity during a migration?

View 1 Replies View Related

Entity Framework: No Support For Server-generated Keys And Server-generated Values

May 23, 2008

Hello

I tried the Beta 1 of the service pack 1 to .net 3.5. If I try to add an entity (and try to save this), I get the Exception "No support for server-generated keys and server-generated values".

How can I add entities to my Sqlce- database?

I tried to give the id- column (primary key) in the database an identity, another time without identity, only primary key --> none of them worked. I always get the same error.

What do I have to change to make successfully a SaveChanges()?

Thanks for your help,
Gerald

View 21 Replies View Related

SQL Server 2012 :: Data Grouping On 2 Levels But Only Returning Conditional Data

May 7, 2014

I think I am definitely thrashing and am not getting anywhere on something I think should be pretty simple to accomplish: I need to pull the total amounts for compartments with different products which are under the same manifest and the same document number conditionally based on if the document types are "Starting" or "Ending" but the values come from the "Adjust" records.

So here is the DDL, sample data, and the ideal return rows

CREATE TABLE #InvLogData
(
Id BIGINT, --is actually an identity column
Manifest_Id BIGINT,
Doc_Num BIGINT,
Doc_Type CHAR(1), -- S = Starting, E = Ending, A = Adjust
Compart_Id TINYINT,

[Code] ....

I have tried a combination of the below statements but I keep coming back to not being able to actually grab the correct rows.

SELECT DISTINCT(column X)
FROM #InvLogData
GROUP BY X
HAVING COUNT(DISTINCT X) > 1

One further minor problem: I need to make this a set-based solution. This table grows by a couple hundred thousand rows a week, a co-worker suggested using a <shudder/> cursor to do the work but it would never be performant.

View 9 Replies View Related

SQL 2012 :: Way To Invalidate Cached Query Plans?

Apr 29, 2014

Any way to invalidate cached query plans? I would rather target a specific query instead of invalidating all of them. Also any sql server setting that will cause cached query plans to invalidate even though only one character in the queries has changed?

exec sp_executesql N'select
cast(5 as int) as DisplaySequence,
mt.Description + '' '' + ct.Description as Source,
c.FirstName + '' '' + c.LastName as Name,
cus.CustomerNumber Code,
c.companyname as "Company Name",
a.Address1,
a.Address2,

[code]....

In this query we have seen (on some databases) simply changing ‘@CustomerId int',@CustomerId=1065’ too ‘@customerId int',@customerId=1065’ fixed the a speed problem….just changed the case on the Customer bind parameter. On other servers this has no effect.the server is using an old cached query plan, but don’t know for sure.

View 9 Replies View Related

Reporting Off Of MS CRM Tying Notes Entity To Opportunity Entity

May 8, 2007

I am trying to create an opportunity report that includes notes from the notes entity. Unfortunatly, when I pull the fields from the notes entity into my reports, it seems there is no way to tie the notes to specific opportunities or accounts that they are associated with and I get all notes under the first item listed on my report. Is there a way to link data sets like Access lets you link tables?

View 3 Replies View Related

SQL Server 2012 :: Invalidate Cached Query Plans?

Apr 30, 2014

way to invalidate cached query plans? I would rather target a specific query instead of invalidating all of them.

Also do you know of any sql server setting that will cause cached query plans to invalidate even though only one character in the queries has changed?

exec sp_executesql N'select
cast(5 as int) as DisplaySequence,
mt.Description + '' '' + ct.Description as Source,

[Code].....

In this query we have seen (on some databases) simply changing ‘@CustomerId int',@CustomerId=1065’ too ‘@customerId int',@customerId=1065’ fixed the a speed problem….just changed the case on the Customer bind parameter. On other servers this has no effect. I’m thinking the server is using an old cached query plan, but don’t know for sure.

View 3 Replies View Related

SQL Server 2012 :: DB2 Store Procedure Returning Two Data Sets

Oct 13, 2014

A DB2 store procedure returns two data sets, when executed from SSMS, using linked server. Do we have any simple way to save the two data sets in two different tables ?

View 1 Replies View Related

SQL 2012 :: Select Statements And Ended Up Seeing Multiple Cached Instances Of Same Stored Procedure

Nov 24, 2014

I ran the below 2 select statements and ended up seeing multiple cached instances of the same stored procedure. The majority have only one cached instance but more than a handful have multiple cached instances. When there are multiple cached instances of the same sproc, which one will sql server reuse when the sproc is called?

SELECT o.name, o.object_id,
ps.last_execution_time ,
ps.last_elapsed_time * 0.000001 as last_elapsed_timeINSeconds,
ps.min_elapsed_time * 0.000001 as min_elapsed_timeINSeconds,
ps.max_elapsed_time * 0.000001 as max_elapsed_timeINSeconds

[code]...

View 4 Replies View Related

Master Data Services :: Can Set Entity As Not Delete?

Oct 4, 2015

Is it possible to set an entity is update but can't add/delete? I want to control adding/deleting members in SSIS from another source system, but only allow users to change certain attributes.

View 3 Replies View Related

List CRM Entity Attributes And Data Types

Oct 11, 2006

Hi,

I am using CRM 3.0 and have a requirement to list all the the tables, attributes names and display names and datatypes. Is there any easy way to export this information from the CRM tool or prepare a SQL query that will list the information?

View 1 Replies View Related

Master Data Services :: Get Value Of A Member From Another Entity

Jul 6, 2015

My problem seems simple but I can't how to do it with MDS... or even if it's possible !

I've got 2 entities "Agent" and "Function". 

"Agent" has a code, a name, and an attribute called "function_code" which refers to "Function"'s code

"Function" as a code and a name. Name is the description of the function. 

I'd like to see in a single row : 

"Code", "Name", "Funcion_code" and "Name" (the last one from the entity "Function"). 

In SQL it will something like 

Select a.code, a.name, a.function_code, f.name
from agent a, function f
where a.function_code = f.code

I've tried with explicit hierarchy, derived hierarchy, consolidated members... 

I was able to have an entity with all those attributes but I can choose the attribute I want. My goal is that, according to "Function_code" in Agent, I get the "Name" of the function... 

View 3 Replies View Related

.NET Framework :: Restoring 2008 Database To 2012 Server With CLR Assembly

Jul 6, 2015

I have a database with deployed CLR assembly on SQL 2008. I recently took a backup for the database and restored it on SQL 2012 server. Everything worked fine except very strange working of CLR assemblies functions.The result of the function is very odd. It manipulates the numeric string and return the result. It is returning very strange result on SQL 2012 as compared to SQL 2008.Example SQL 2008 ManipulateString('1234') returns 2345 On SQL 2012 the same call returns 1155.I am also trying to deploy the same assembly to SQL 2012 server database. I have successfully register the assembly, but the database do not list the exposed methods.

View 5 Replies View Related

Master Data Services :: Default Date In MDS Entity

Dec 16, 2014

Is there any way to set a default date for a member in MDS. My requirement is that business user can enter either current date or future date but not past date.

View 3 Replies View Related

SQL 2012 :: NET Framework Error Occurred During Execution Of User-defined Routine Or Aggregate

Aug 4, 2015

when i try to deploy a packages in integration service catalog i am getting the below error

.NET Framework error occurred during execution of user-defined routine or aggregate

"deploy_project_internal":

System.ComponentModel.Win32Exception: A required privilege is not held by the client

System.ComponentModel.Win32Excepbon:

at Microsoft. SqlServer. IntegrationServices.Server.ISServerProcess.StartProcess(Soolean

bSuspendThread)

at Microsoft.SqlServer.IntegrationServices.Server.ServerApi.DeployProjectlnternal(SqlInt64 deployld,

SqIInt64 versionld, SqlInt64 projectld, SqlString projectName)

. (Microsoft SQL Server, Error: 6522)

View 0 Replies View Related

Master Data Services :: MDS Filter Entity Based On Attribute From Another Domain?

Oct 28, 2014

I have an entity (A), in which I use domain based attribute. The second entity (B) has several attributes. My problem is that, I would like to filter the first entity (A) based on an attribute that belongs to the second entity. The only way I can filter it (in MDS Excel add-in or Explorer) is by using Code or Name from the second entity.

I have in mind a couple of solutions, but they require some coding with xml saved query from Excel.

View 4 Replies View Related

Master Data Services :: Insert Or Update Using WCF API Is Flagging Entity Member For Revalidation

Dec 21, 2012

I have an API which uses the MDS WCF methods to update and insert entity members into MDS. Its working as expected. But whenever a entity member is inserted or updated, the validation flag is set to "requires re-validation" (With "?" symbol). Is there a setting which has to be set to validate the record once inserted or updated by API? Or should it be validated explicitly once the insert or update happens?

View 4 Replies View Related

Master Data Services :: Setting Read Permission On Entity Attribute Makes Model Disappear

May 21, 2013

My company is new to MDS. I am trying to set an attritube in an entity to read only so the users can't change the value in that field. When I did that, the whole model disappeared. I thought I had deleted it by accident so I created a test model and tried to do the same. The test model disappeared. This time, before saving the new settings I took a snapshot. After saving I took another snapshot. You can see that the whole model is gone (zz_RN_Permissions_Test). I tried every other coworker with admin rights and nobody shows it on the Models list. The behavior on the Excel add-in is correct. I can't change any values on that column. But I need to keep the models available.

See before and after snapshots below.

View 8 Replies View Related

Framework 3.0 In OS, Need Framework 2.0 For SQL Server 2005

Sep 22, 2007

Hi,

Can anybody help me with the following problem:

I have Vista Ultimate installed and within Vista .NET Framework 3.0 is installed as a part of the operating system so I can't remove 3.0
Now for MS SQL Server 2005 Express I need .NET Framework 2.0 and the SQL Server 2005 doesn't work with .NET Framework 3.0
Can't install 2.0, get the message that 3.0 is already installed.
Please help me!!

René

View 5 Replies View Related

Internal .Net Framework Data Provider Error 1.

Apr 20, 2006

VS2k5   Win2k3IIS6.NET 2.0In my ASP.NET 2.0 app I create and open an SQL connection in the page's constructor and call Dispose() in the destructor.  The SQLConnection object is a class member of the page.  This page makes heavy use of the SQLConnection object so I felt opening and closing in the constructor/destructor respectively was good design.  I know this doesn't take full advantage of connection pooling.  Any design input would be very much appreciated.Here's the destructor code:/// Destructor~Officer(){    if( m_objConn != null )        m_objConn.Dispose(); // <-- Exception occurrs here.}/// End DestructorWhen running this particular page through some testing I get the following exception in the destructor at the "m_objConn.Dispose();" line:System.InvalidOperationException was unhandled  Message="Internal .Net Framework Data Provider error 1."  Source="System.Data"  StackTrace:       at System.Data.ProviderBase.DbConnectionInternal.PrePush(Object expectedOwner)       at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject)       at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory)       at System.Data.SqlClient.SqlConnection.Close()       at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)       at System.ComponentModel.Component.Dispose()       at Officer.Finalize() in c:sysprojectsAddOfficer.aspx.cs:line 461)  Is this design good/bad?1)  Is this a bug?2)  Do I need a try/catch in a destructor?  Is it good programming practice?3)  Why is this happening?4)  What is the meaning of life?Any help is appreciated.  TIA

View 2 Replies View Related

System.Data.SqlServerCe Desktop Vs Compact Framework

Aug 7, 2007

How can I tell if the System.Data.SqlServerCe assembly I am referencing is meant for Desktop use as opposed to Compact development? We are using NUnit as our testing framework and I get the following error when I attempt to execute nunit-console on my test fixture referencing SqlServerCe:

System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---->

System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


The unit tests run fine from inside of Visual Studio using the Resharper Unit Test Runner...

Matt

View 1 Replies View Related

.Net Framework Data Provider For MySAP Business Suite

Feb 18, 2008

I am pulling data out of SAP ECC 6 to MS SQL server 2005 from Task - Import data .Net Framework Data Provider for mySAP Business Suite

The data which I am getting out of SAP gets multiplied by 1000 i.e. Table CE1LSC0 has field VVQTY which is Quantity€¦
The value of quantity in SAP is 8.0 when I pull in by the aforesaid tool it come as 8000.00.

Do anyone has any idea what is going wrong, I even ask the basis guys to reinstall the Function module required for .Net Framework Data Provider for mySAP Business Suite in SAP.

I uninstalled .Net Framework Data Provider for mySAP Business Suite tool and reinstalled it but still I am encountering the same problem.

View 1 Replies View Related

Master Data Services :: Filter Column Based On Other Column In Same Entity

May 12, 2015

Using MDS 2012: I have an entity "XYZ_Entity".  In "XYZ_Entity" entity I have 2 domain based Columns "DealerGroup" and "Dealer".

While inserting information into "XYZ_Entity" entity user can select the required dealer group from domain base Dealer Group values. Now for selecting Dealer he wants the dealers to be filter based on selected dealer group and he can select from the filtered list. reason to do that is he don't want to go through thousands of dealers and select an incorrect one.

Is it possible, if yes then how?

View 2 Replies View Related

Master Data Services :: How To Add A Reference To Another Entity Member When Creating A Member

Oct 23, 2014

I need to create a member that one of its Attributes (maybe my term is wrong) is a reference to another entity member named group 
the code 

createRequest.Members.MemberType = MemberType.Leaf;
createRequest.Members.Members = new System.Collections.ObjectModel.Collection<Member> { };
Member aNewMember = new Member();
aNewMember.MemberId = new MemberIdentifier() { Name = uag.groupName, MemberType = MemberType.Leaf };

[code]....

 "The attribute data type is not valid".Is it wrong to add the reference as attribute? How can I embed the reference in the new member? 

View 4 Replies View Related

SQL Server 2012 :: Returning Value For Foreign Key

Dec 5, 2013

I have a table tbl_rules. This table will define rules for each role. I have not yet defined the fields for the rules. But the table definition is as below:

Create table tbl_Rules
(
ID int identity(1,1) not null,
Role_ID int not null,
primary key (ID),
constraint fk_RoleName foreign key (Role_ID)
references tbl_Role(ID)
)

The table tbl_role has two columns as below:

ID RoleName
1 Manager
2 Analyst
3 Admin

So far so good. I created the tbl_rules.

But what i want to do is when I do select * from tbl_Rules, i want to show as below:

ID Role_ID
1 Manager
2 Admin

Instead it shows:

ID Role_ID
1 1
2 3

Is there a way to do this? The goal is to return the select * from tbl_Rules results to a gridview to enable adds and changes. I could do this by doing queries for each column, but I was hoping to make it easier. Not sure if this is even possible.

View 1 Replies View Related

.NET Framework :: CLR Stored Procedure With Table Data Type Parameter

May 27, 2015

I want to create a CLR Stored Procedure with a Table User Defined Type like this short example in SQL:

CREATE TYPE [dbo].[TypeTable] AS TABLE
(
[Id] [integer] NOT NULL,
[Value] [sysname] NOT NULL,
PRIMARY KEY CLUSTERED

[Code] ....

I found some example in this link : CLR UDT

But I can't figure how to do the same with a User Defined Type Table.

View 5 Replies View Related

Genral Network Error On .net Framework 1.1 Using System.data.sqlclient In Asp .net

Feb 24, 2006

hi i am using asp .net 1.1

i have deployed my application on server where sql server 2005 exists but if i try to connect to sql server from my development machine then it is not connecting and gives me error when

conn.open()

in my sql server it is windows authentication.

the error is general network error check network docs.

i have tried timeout=0 and pooling=false

but neither works please answer.

what should my connection string.



View 1 Replies View Related

Failed To Find Or Load The Registered .Net Framework Data Provider.

Oct 28, 2007



Hi Everyone,

I've just finish re-installing VS.NET 2005 and tried the Walkthrough: Displaying Data in a Web Forms Page
I followed exactly as it is that is I tested the connection "Connection Sucessful", test Query "Successfull" but when i run it prompt me with the following error message:



-------------------------------------------------------------------------------------------------
Failed to find or load the registered .Net Framework Data Provider.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.

Source Error:







[No relevant source lines]

Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesw9f240aab3a2217cc8App_Web_cztxhfge.0.cs Line: 0

Stack Trace:







[ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.]
System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) +1374119
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +109
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory() +63
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactorySecure() +19
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +120
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6931
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesw9f240aab3a2217cc8App_Web_cztxhfge.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


------------------------------------------------


please help and point out what is the issue?
Thanks in advance for your help.

View 1 Replies View Related

SQL 2012 :: Table (with Zero Rows) Not Returning Any Result

Jun 26, 2014

I am trying to run queries on a table (table has zero rows). Inspite of giving 0 rows returned the query keeps on running and I have to cancel it. I tried inserting a dummy row into the table but even the insert operation is taking too long.Every query which I hit on the table just keeps on running without giving any result.

But this is not the case with other tables in the database.They are all running fine giving proper results. But this one table is behaving funny.

View 3 Replies View Related

SQL 2012 :: Variable Returning Asterisk Instead Of Error

Aug 27, 2014

This query was run against a database on 2008 SP3 and 2012 SP2

Here is an example of what I ran

Declare @A_number varchar(5)
Select Top 1 Column_Is_an_int = @A_number
From Our_Main_Table
Where A_Database_Name = 'A database with many records in this table and multiple records in the Column_is_an_int some are more than 5 characters'

Select @A_number
Exec My_Stored_Proc @A_Nmuber

The top result for that database had an integer that was 8 characters including the - sign.

When the query ran I would normally expect it to throw the binary data cannot be truncated error. However in this case it returned a * in the variable which then tried to pass it in to the SP which of course threw a fit.

Once I changed the varchar(5) to varchar(50) it worked perfectly.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved