DataSource Controls :: .edmx Excluding A Relationship?
Apr 25, 2010
I need to know if I've done something wrong, or if the message I'm getting is nothing about which to be alarmed.I'm getting "The relationship '....' has columns that are not part of the key of the table on the primary side of the relation ship which is not supported, the relationship was excluded.
I built four tables, each with one foreign key. I'm assuming I haven't done anything wrong or unusual with my four tables (SQL statements generating the tables are shown below).However, I don't get any lines connecting tables together and all the examples I've seen today seem to have no problem with drawing the connecting lines all over the place.
I need to create a SELECT statement for a table that excluded the TOP 10 records.
"SELECT TOP 10 field1,field2,field3 FROM AppData ORDER BY field1 DESC" returns the first 10 records from the table but I need to retrieve only from the 21st record onwards.
I simply don't know how to do it because I'm not that strong with SQL. I searched the forum for some answers but can't find a solution that I can understand.
from tblData left join tblfacility ON tblData.employee_num = tblfacilit.employee_num left join tblextension ext on tblData.extension = ext.extension
tablExtension has phone number extension in it. If we don't know someones phone extension, we put zero for their extension, now there are tons of people who have zero extension.when I run this query, it returns same name lot of times with different cubeNumber so I get
a ax 1 12 0 a ax 1 13 0 a ax 1 14 0 b bx 2 12 0 b bx 2 13 0 b bx 2 14 0
Both emploee a and employee b extensions are zero in above case. I want both a and b to be displayed only once .Right now it is displaying them so many times with all the cubesNumber that have extension zero.
I have a database which contain job ads/ I have one table "dbo.tbl_jobadvert" which contains the ad itself and another table "dbo.tbl_jobFiles" which contains the path of the documents uploaded in relations to the job advert ( application form, job description, etc )
I recently started explore MVC and just tried some samples around, i.e. MvcMusicStore.
As the sample DB in MvcMusicStore is quite small, I am wondering how should I design the edmx/entity for a bigger database, let say for an enterprise application, which has more than 20 tables as in AdventureWorks?
Thus, the question is should I include all in one edmx/entity or I should include multiple edmx/entities when I designing the model?
I have 2 tables. Table_A has one to many relationship with Table_B.
For example. Table_A has an ApplicantKey and in Table_B I am storing (Resume_name and CoverLetter_name for the Applicant). Joined by ApplicantKey
Now when I join them and execute the query obviously it returns me two rows. But what I want is that it should return only one row with Columns like Resume_name, CoverLetter_Name
I working on website and i have ready database from the company database. I have a table Location has only two fields : city andtate.I tried to get select the * city where state = something , but i think it is wrong,Is it a Many-to-Many realtionship
I have two tables - dt(Mods) and dt(Mods2) - I am trying to create a relationship between them. So dt(mods) has department, category and item columns dt(mods2) has parentDept, Parentcategory and parentItems Now I need add them to a dataset with a relationship key - Something like this but with three cloumns
Dim ParentCol As New DataColumn, ChildCol As New DataColumn
I have 3 tables User, role and UserInRole THe entity frame work made entities for User and Role and I have successfully made a join with the user and role entities using user.add(role); but I can't seem to get it to remove the link (I want to retain the user and role just remove their association).
using (ProviderEntities context = new ProviderEntities()) { User u = context.User .Where(n => n.ApplicationName == application) .Where(n => n.Username == username).First(); Roles r = context.Roles .Where(n => n.ApplicationName == application) .Where(n => n.RoleName == roleName) .First(); r.User.Remove(u); context.SaveChanges(); }
The oposite worked when I did r.User.Add(u); but it wont let me now remove it after it been created. Driving me mad as I can't see where I have gone wrong.
a FormView that is linked to SqlDataSource1a Repeater control (inside the formview) that is linked to SqlDataSource2 Thus representing a simple "1 to many" or "parent/child" relationship in the database!
SqlDataSource1 is simple in that it just retrieves a straight set of records from a table and they are displayed back in the FormView (nothing special happening there).
SqlDataSource2 has parameters that filter the contents of the repeater based on the record that is shown in the Formview. This would normally be simple enough to set up by setting the parameter to the formview.selectedvalue property.
HOWEVER - THE PROBLEM ARISES...
The formview has multiple DataKeyNames because the table that the SqlDataSource1 links to has a compound key. So to filter the Repeater correctly SqlDataSource2 needs to map 3 parameters to 3 data key values in the formview.
I've tried setting the SqlDataSource2 parameters to:
My Question is can we extend one context to another in Entity Framework 4. Following is the problem background.
I am using EF4 for developing a Web-Application. My Web Application has 3 projects.
One project is for storing candidate CV information.
Another project is for storing customer information.
Final project is called CORE. this CORE contains a edmx file that should be extended by CV and CRM.
As an example email address table can be shared by both customer (CRM) and CV. To share one table with another, we should be able to extend one context (CV context) with other context (customer context). Could some one having experience using Entity Framework share your experience with me to find whether this is possible.
We have 3 edmx files in three class libraries:
Person class library(Core) with core.edmx-Basic details related to a person(name, email) CV Class library with CV.edmx wich have CV related data(Experiance,skills) Customer Relationship management system(CRM) which have customer data(sales data...)
Then we want to use core class library edmx file(Core.edmx) with cv.edmx (basically cv tables should be able to use tables from core tables) . Same way we want to use the core.edmx with CRM.edmx for the 3 rd project
So we use formviews all over the place that recently we've started putting user controls inside that have databinding controls inside them. In this instance it's a grid so
That's the basic sitch. We have the customGrid, a usercontrol, bind to a collection on the main DataItem, and it contains dynamiccontrols (DD4) in its column templates so stuff in the cells displays right. (in reality, the customGrid is inside a dynamiccontrol like all the other fields here and is loaded based on ui hints, I've just stuck it in the pseudo-markup here for illustration). This works a charm, up until you try and update the formview. At that point, the FormView grabs all the keys from all the dynamiccontrols in its edititemtemplate, including keys and values from dynamiccontrols insde the customGrid control. Obviously this doesn't work as those are for an "address" object or something, and the formview is bound to a "person" object. What i desperately need is a way, inside customGrid, to stop FormView from getting out all the dynamiccontrol keys and values inside it. Overriding DataBindChildren doesn't work, nor DataBind. I don't know at what point or how the FormView queries its instantiated template for all the 2-way databinding controls it has inside it, but if I could get at that maybe I could figure something out. Or else, if I could make the customGrid stop sending back all the values inside it.
I tried overriding the formview's OnItemUpdating but that only so much; I can remove entries from the e.NewValues collection if they don't exist on the DataItem, but that doesn't if your custom sub control is binding items with fields of the same name as your main dataitem. There must be a way to abort this 2 way databinding in the custom control.
I am using forms authentication in my ASP.NET MVC application. I want to the signup page from the authorization process. I know I can add a location tag in my main web.config file or create a new web.config inside the specific folder. But I just to exclude one specific action in the User controller. How do I do it?
Looking through my web logs, I see a lot of entries that don't interest me. Some of them are commonly used images, css files, and scripts, which I can easily exclude by un-checking the 'log visits' check box in IIS for the folder properties.
I would also like to exclude log entries for certain common requests which are not in their own folders. Mostly, 'favicon.ico'. 'scriptresource.axd', and 'webresource.axd'. These (especially scriptresource.axd) make up almost a third of a typical log file on my site.
I have a requirement where i want compare only the date part of a DateTime Object not the seconds with the another object.I tried if(DateTime.Compare(dt1, dt2) == 0) where it compares both date and seconds, but i want only date part.
This may not be correct place to rise this question. Even i'm making here..
My requirement is to get the number of days from from date to end date (for Eg. I have to text boxes from date and to date i will send datetime value to my Stored porcedure i need to calculate no of days between these dates (i.e. no of wroking days) Is there any function to achieve this in SQL SERVER 2005)
I am using a Datalist and a Listview in a Master/Detail relationship. Each time a DataList item is bound, a Listview is loaded dynamically. I have provided the relevant Layout and Item templates. It is worked fine for one item. But for more than one item, it will raise the following error: "An item placeholder must be specified on ListView 'ItemListView'. Specify an item placeholder by setting a control's ID property to "MyLayout$itemPlaceholder". The item placeholder control must also specify runat="server". Despite having set up the item placeholder.
I tried excluding some files and folders in VS 2008 and they just disappear when I just want them to appear "whited" out. How can I change this behavior?
I've been wracking my brains for a while. I have a master record that I want to add children to. In a database it's a one to many relationship with a foreign key in the child table.
I have a formview that I want to use to fill in all the master record info, and choose the child info from a dropdownlist, and click an add button, and have the add button add the child info to some control on a page. Then when the user clicks insert, the formview has an ItemInserting EventHandler that will handle all the logic for inserting the master, grabbing its primary Key.
So, I know what to do, I'm just not sure of what control to use, or what memory object etc., that I want to store the child info in until the master record gets created.
I'm sure this has been done a million times, but for all my searching, I couldn't find anything to help me. Does anybody have some advice or can anybody point me to an internet resource where this has been hashed out?