.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Am I missing something here? EF Table per Type Inheritance

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net
 

Getting started with EF and working on getting a basic inheritance set up, but it's not being agreeable. Am I missing something here?

Tables:

-ContentItem-
ContentItemId (PK)
Title
Description
...etc

contains 2 records, let's say their ContentItemId's are 101 and 102

-Event-
ContentItemId (PK)
StartTime
...etc

contains 1 record, with ContentItemId of 101

In the VS2008 EF modeler I've done the following:

-Deleted the original relationship
-Made Event inherit from ContentItem
-Deleted the ContentItemId from Event and mapped it to the inherited value

then in the code:

        public IQueryable<Event> GetCalendar()
        {

            var all = from e in context.ContentItem select e;
            var query = from e in context.ContentItem.OfType<Event>()
                    select e;
            return query;
        }


When I break at the return statement I have 2 records in "all" and 0 records in "query"... I would expect their to be 1 record (id 101) in "query", am I missing something here?




View Complete Post


More Related Resource Links

The type 'DataGrid' was not found. Verify that you are not missing an assembly reference and that

  
Hi; I'm new to WPF and I was going through the ExpenseIt tutorial on MSDN's website. The tutorial was working fine until I added DataGrid. I got the error message: "The type 'DataGrid' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."     I could not find a clear answer online of which assembly references to fix and how to fix them. Any help would be appreciated. Thanks!     Note: I'm running the following: Windows Vista 32-bit operating system Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1

want to autoincrement a character type in table

  
For Example, "E0001" Everytime  it will automatically incremened by 1. "E0001" -> "E0002-> "E0003" and so on. "E0010" -> "E0011" and so on. "E0100" -> "E0101" and so on.  

Creating a table-valued function on a user defined type in SQL Server CLR

  
We would like to be able to create a table-valued function on a user defined type.  We would like the syntax in SQL to look like it works for the XML nodes function:   DECLARE @myXml XML = '<a><b>1</b><b>2</b><b>3</b></a>' ; SELECT  node.query('text()') FROM    @myXml.nodes('a/b') nodes (node) ;   In other words, in the FROM clause, we can access the "nodes" method of the xml variable and it returns a rowset. Thanks!

how to include a user defined table type as input for stored procedure

  
Hi ,  I have a user defined table type which i need to pass as input parameter to the stored procedure .How can i do that?

The type 'DropShadowEffect' was not found. Verify that you are not missing an assembly reference a

  
We created a grid in Expressions Blend but the DropShadowEffect caused an error for a developer who tried to build the solution and did not have Expressions Blend on his machine.  Had to replace with  <Border.BitmapEffect><DropShadowBitMapEffect ... Are there other incompatibilities between Expressions Blend and plain old Visual Studio 2008 development environs? <   UserControl   xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation   xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml   xmlns:d=http://schemas.microsoft.com/expression/blend/2008   xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006   mc:Ignorable="d"   xmlns:igRibbon=http://infragistics.com/Ribbon   x:Class="TestEditor.Ctrl_PR"   x:Name="UserControl"   MaxWidth="450"   d:DesignWidth="450" d:DesignHeight="125">     <Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5" Width="450" Height="125">   <Border CornerRadius="8" BorderBrush="DarkSlateBlue" BorderThickness="0.5" HorizontalAlignment="Stretch" Grid.ColumnSpan="2">     <Border.Background>       <LinearGradientB

Analysis Service Oracle Number inconsistent Data Type for TABLE or Named Query

  
Dear Gurus, I'd VERY OLD PROBLEM. And I believe it addressed since 2006. When I design DataSource Views from Oracle Data Source. I found it return different oracle number data type for TABLE or NAMED QUERY   Provider Data Type Column Data Type Data Source View Data Type Oracle OLE DB Provider (OraOLEDB.Oracle.1) Table Number System.Int64   View Number System.Decimal   Named Querey Number System.Decimal Microsoft OLE DB Provider for Oracle (MSDAORA.1) Table Number System.Double   View Number System.Double   Named Query   1 System.Int64   Named Query   1.1234 System.Int64 Althought I know I can fix IT via MANUALLY EDIT DATASOURCE VIEW XML SOURCE. But I don't think this is a better solution. Is anybody have ideas ?  Wilson

Get inserted ids when inserting from User Defined Table Type

  
Imagine this procedure:   CREATE PROCEDURE [dbo].[insertActive] ( -- Add the parameters for the stored procedure here @p_data dbo.activeUpdate readonly) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. insert into dbo.active (name,stateid) select name,stateid from @p_data END How can I get the ids of the rows that have been inserted?  I tried searching the net and the forums but could not find anything. Thanks for any and all help, Gareth.

Ms sql query for this type of table structure

  
Hi This is my Table structure Field1       Filed2        001          A001          B001          C 001          D002          A003          B 003          C I need MS SQL query I need to show Field1 which has B and Not in DI mean 003 will shown coz it has B still D not comes... and 001 ,002 will not shown Coz 001 has B and D and 002 will not shown coz still it doesnt have B..Need Query... 

Merge replication - table with geography data type

  

Hi,

I have a problem with geography data type replication. Any change that is done on a Geography column breaks the replication - the error message is "The Merge Agent failed because the schema of the article at the Publisher does not match the schema of the article at the Subscriber." I double checked compatibility settings that is suggested here: http://social.msdn.microsoft.com/Forums/en-US/sqlreplication/thread/d8e31621-5d43-48cd-bdd3-c02b8a24625c. But both publisher and subscriber are 100RTM.

I checked synchronization logs and found a strange message - attempt to convert varchar to geography. I don't understand from where the varchar data type comes from. Tables at subscriber and publisher has the same format - geometry stored in geography data type.

2010-09-20 18:36:22.499 The Merge Agent failed because the schema of the article at the Publisher does not match the schema of the article at the Subscriber. This can occur when there are pending DDL changes waiting to be applied at the Subscriber. Restart the Merge Agent to apply the DDL changes and synchronize the subscription.
2010-09-20 18:36:22.845 Category:NULL
Source:  Merge Replication Provider
Number:  -2147199398
Message: The

Missing partial modifier on declaration of type XXX ; another partial declaration of this type exist

  

Hi,

I have a web service that it's working fine with a mobile application built on compact framework.

Now i need to grant access to a 3rd party java application that reported some errors.

I used .NET WebserviceStudio to examin the webservice and i got a bunch of errors

 

Initializing
Generating WSDL
Generating Proxy
Compiling Proxy
 error CS0260: Missing partial modifier on declaration of type 'T_DIST_DistributerTables'; another partial declaration of this type exists
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for 'VW_RPT_SERVICERowChangeEventHandler'
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for 'T_PDA_ServiceCurrentSubStateRowChangeEventHandler'
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for 'T_PDA_ServiceSubStateMovRowChangeEventHandler'
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for 'T_PDA_CalendarRowChangeEventHandler'
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for 'T_PDA_MessageRowChangeEventHandler'
 error CS0102: The type 'T_DIST_DistributerTables' already contains a definition for '

Correct Boolean type when designing database table?

  

In my VB.Net code I am using boolean type and it is later stored through a stored procedure to a MS SQL database table. I have so far allways been using "int" as the column type in database table because there is no Boolean type to choose from when designing the columns of a table in the MS SQL Express?


Is it correct to use the column type int for storing Boolean values?


/Kontorslokaler Stockholm


Content Query Webpart Missing Content Type and Approval Status

  

I'm a great fan o the CQWP , and love the changes made in 2010 on this webpart. What bothers me is that I use to Filter Documents by Approval Status, thus showing Draft or Pending Documents and Group these by their Content Type.

Both these were available in 2007, but removed from 2010 CQWP. Any idea why, or how to bring this back? sample or URL guidance would be great. My gut feeling is custom XSLT but id like to confirm this first.

Thx a lot

 

 


Cannot modify a column type in a table in SQL Serv 2008 Ent

  
I used ot be able to do it when the same tables were part of Sql Express: to change the column type in SSMS but now I get an error. I have never seen it before. I created a large number of table in one DB and for some reason I cannot recall, some of them ended up with int type for volume column, others bigInt. They all appear to have been created from .NET C# code not manually. Now I am getting exceptions because my code expects Int64 across the board.

This is the message that pops up when I try to save the change:

Saving Changes is not permitted. The changes you have made require the following tables to be dropped and recreated. You have either made changes toi a table that can't be recreated or enabled the option prevents saving changes that require the table to be re-created.

Apparently some option is set up wrongly in the Properties=>Options. the question is which one? I checked all Alter options and still cannot save the change.


Thanks.
AlexB

resource type SQL Server & SQL Server Agent missing after setup

  

Hello,

after the SQL setup I noticed that the resource types "SQL Server" and "SQL Server Agent" were missing. (one node setup, 2nd node was joined later) Well I was able to manually create them but they won't start. The OS is Server2008 R2 and SQL is SQL 2008 - NON R2, yet.

The resource "SQL Server" is in a failed state (please find the error message right below)

(An error occurred while attempting to bring the resource 'SQL Server ('instanceName')' online.Error Code: 0x8007139a
The cluster resource could not be brought online by the resource monitor).

"SQL Server Agent" is offline due to its dependency, the resource "SQL Server".

I already tried to repair the installation,  compared the properties of the 2 resources with a a working SQL2k8 cluster but with no success.

Does anyone have any idea what I could try next?

Thank you in advance

Masl

 

 

 


resource type SQL Server & SQL Server Agent missing after setup

  

Hello,

after the SQL setup I noticed that the resource types "SQL Server" and "SQL Server Agent" were missing. (one node setup, 2nd node was joined later) Well I was able to manually create them but they won't start. The OS is Server2008 R2 and SQL is SQL 2008 - NON R2, yet.

The resource "SQL Server" is in a failed state (please find the error message right below)

(An error occurred while attempting to bring the resource 'SQL Server ('instanceName')' online.Error Code: 0x8007139a
The cluster resource could not be brought online by the resource monitor).

"SQL Server Agent" is offline due to its dependency, the resource "SQL Server".

I already tried to repair the installation,  compared the properties of the 2 resources with a a working SQL2k8 cluster but with no success.

Does anyone have any idea what I could try next?

Thank you in advance

Emeska

 

 

 


SharePoint 2010 External Content Type and InfoPath 2010 - Numeric data type fields missing in InfoPa

  

Connected SQL data table to SP 2010 ECT from SQL table.  The SQL table has several fields that have a type of "numeric(3,0)".  The SP 2010 list shows all fields form SQL.  When we open up InfoPath Designer and reference the SP List data (from SQL) all of our numer fields are missing from the available fields list.

I amd going to try another data type but that hardly feels like a solution.  If anyone has any ideas please let me know!


Fact Table Missing Records

  

  I am updating FACT TABLE. I am getting all the facts but when I do look-up to get corresponding values in the associated Dimensions, I am unable to find some of the records (say its missing or some inconsistent data or corrupt). So how do I go from here?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend