Search Results

Search found 23 results on 1 pages for 'user169867'.

Page 1/1 | 1 

  • Entity Framework 4 ste delete foreign key relationship

    - by user169867
    I'm using EF4 and STE w/ Silverlight. I'm having trouble deleting child records from my primary entity. For some reason I can remove child entities if their foreign key to my primary entity is part of their Primary Key. But if it's not, they don't get removed. I believe these posts explains it: http://mocella.blogspot.com/2010/01/entity-framework-v4-object-graph.html http://blogs.msdn.com/dsimmons/archive/2010/01/31/deleting-foreign-key-relationships-in-ef4.aspx My question is how how do I remove a child record who's foreign key is not part of its primary key in Silverlight where I don't have access to a DeleteObject() function?

    Read the article

  • CSS height problem. IE8 seems correct Firefox seems wrong. Any fix?

    - by user169867
    Below is a complete html page that shows the problem. The "myDiv" should be 22px in height (including the border). Item 1 should have a 1px space between its border and the divs border. In IE8 it is. In FF 3.6.2 though it is 24px and I can't understand why. Ultimately my goal is to get the same CSS to create the same result in both browsers. It's driving me crazy! Any help would be appreciated :) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <style type="text/css"> div.aclb {background:#EEF3FA; color:#666; cursor:text; padding:1px; overflow-y:auto; border:#BBC8D9 1px solid; } div.aclb:hover {border:#3399FF 1px solid;} div.aclb.focus {background:#FFF; border:#3399FF 1px solid;} div.aclb ul {padding:0; margin:0; list-style:none; display:table; vertical-align:middle; } div.aclb li {float:left; cursor:default; font-family:Arial; padding:0; margin:0;} div.aclb li.block {padding:0px 2px; height:16px; white-space:nowrap; border:solid 1px #BBD8FB; background:#f3f7fd; font-size:11px; line-height:16px;} div.aclb li.block:hover {border:solid 1px #5F8BD3; background:#E4ECF8; color:#000;} div.aclb li.input {} div.aclb input {margin:0; padding:0; height:18px; background:transparent; border:none; color:#666; overflow:hidden; resize:none; font-family:Arial; font-size:13px; outline:none;} div.aclb input:focus {margin:0; padding:0; height:18px; background:transparent; border:none; color:#22F; overflow:hidden; resize:none; font-family:Arial; font-size:13px; outline:none;} div.aclb a.d {cursor:pointer; display:block; color:#6B6B6B; width:13px; height:12px;float:right; margin:1px 0 1px 4px; border:solid 1px transparent; font-family:Verdana; font-size:11px; text-align:center; line-height:10px;} div.aclb a.d:hover { border:solid 1px #7DA2CE; background:#F7FAFD; color:#AD0B0B;} div.aclb a.d:active {border:solid 1px #497CBB; background:#BAD8E8; color:#A90909;} </style> </head> <body> <div id="myDiv" style="width:250px" class="aclb"> <ul> <li class="block"> <a class="d">x</a><span>Item 1</span> </li> <li class="input"> <input type="text" style="width:30px" maxlength="30"/> </li> </ul> </div> </body> </html>

    Read the article

  • using jquery draggable can you create a helper based on the dragged item?

    - by user169867
    I wish to create a custom helper based on the element being dragged. I'm dragging documents and I'd like the document's number to be part of the custom helper. I know how to create a helper during init like this: helper: function() { return $("<div class='fax16'></div>"); } But what I really want to do is maybe in response to the start event get access to the element being dragged and use some of its properties to set the helper. Something like: start: function(event, ui) { var docID = //somehow access the dragged element ui.helper = $("<div class='save16'>" + docID + "</div>"); //Set drag Helper } Can this be done?

    Read the article

  • linq sort many 2 many question

    - by user169867
    My main entity is called [Contract]. Contract has a many 2 many relationship w/ [Service]. When I query for a list of Contracts I grab the 1st Service available like this: q.Select(c => new ContractSearchResult() { ContractID = c.ContractID, FirstService = c.Contract2Service.FirstOrDefault().Service.Name, ServiceCount = c.Contract2Service.Count, } ).ToList(); q is an IQueryable that has some filtering & paging already applied. (When I display this list I show the FirstService if there's only 1. If 1 I show "My1stService (3)" to show I'm seeing the 1st of 3 services) This works fine. My question is this: Is there any way to sort by FirstService? Or is this impossible? I haven't found a way of expressing this in linq. Any help would be appreciated.

    Read the article

  • Why does calling abort() on ajax request cause error in ASP.Net MVC (IE8)

    - by user169867
    I use jquery to post to an MVC controller action that returns a table of information. The user of the page triggers this by clicking on various links. In the event the user decides to click a bunch of these links in quick succession I wanted to cancel any previous ajax request that may not have finished. I've found that when I do this (although its fine from the client's POV) I will get errors on the web application saying that "The parameters dictionary contains a null entry for parameter srtCol of non-nullable type 'System.Int32'" Now the ajax post deffinately passes in all the parameters, and if I don't try and cancel the ajax request it works just fine. But if I do cancel the request by calling abort() on the XMLHttpRequest object that ajax() returns before it finishes I get the error from ASP.Net MVC. Example: //Cancel any pevious request if (req) { req.abort(); req = null; } //Make new request req= $.ajax({ type: 'POST', url: "/Myapp/GetTbl", data: {srtCol: srt, view: viewID}, success: OnSuccess, error: OnError, dataType: "html" }); I've noticed this only happen is IE8. In FF it seems to not cuase a problem. Does anyone know how to cancel an ajax request in IE8 without causing errors for MVC? Thanks for any help.

    Read the article

  • How to create a static header that remains even when navigating to other pages (lala.com)

    - by user169867
    I'm interested in the way lala.com works. They have a header that remains fixed at the top of the browser and they have a flash music player in it. You can click on other links in the site and they are displayed below the header but the header is not disrupted and can continue playing music. If the target is a modern browser say IE8 & FF 3.6, what's the best way to achieve this? Thanks for any help.

    Read the article

  • Is it worth caching a Dictionary for foreign key values in ASP.net?

    - by user169867
    I have a Dictionary<int, string> cached (for 20 minutes) that has ~120 ID/Name pairs for a reference table. I iterate over this collection when populating dropdown lists and I'm pretty sure this is faster than querying the DB for the full list each time. My question is more about if it makes sense to use this cached dictionary when displaying records that have a foreign key into this reference table. Say this cached reference table is a EmployeeType table. If I were to query and display a list of employee names and types should I query for EmployeeName and EmployeeTypeID and use my cached dictionary to grab the EmployeeTypeIDs name as each record is displayed or is it faster to just have the DB grab the EmployeeName and JOIN to get the EmployeeType string bypassing the cached Dictionary all together. I know both will work but I'm interested in what will perform the fastest. Thanks for any help.

    Read the article

  • How to have member variables and public methods in a jQuery plugin?

    - by user169867
    I'm trying to create a jQuery plugin that will create something like an autoCompleteBox but with custom features. How do I store member variables for each matching jQuery element? For example I'll need to store a timerID for each. I'd also like to store references to some of the DOM elements that make up the control. I'd like to be able to make a public method that works something like: $("#myCtrl").autoCompleteEx.addItem("1"); But in the implementation of addItem() how can I access the member variables for that particular object like its timerID or whatever? Below is what I have so far... Thanks for any help or suggestions! (function($) { //Attach this new method to jQuery $.fn.autoCompleteEx = function(options) { //Merge Given Options W/ Defaults, But Don't Alter Either var opts = $.extend({}, $.fn.autoCompleteEx.defaults, options); //Iterate over the current set of matched elements return this.each(function() { var acx = $(this); //Get JQuery Version Of Element (Should Be Div) //Give Div Correct Class & Add <ul> w/ input item to it acx.addClass("autoCompleteEx"); acx.html("<ul><li class=\"input\"><input type=\"text\"/></li></ul>"); //Grab Input As JQ Object var input = $("input", acx); //Wireup Div acx.click(function() { input.focus().val( input.val() ); }); //Wireup Input input.keydown(function(e) { var kc = e.keyCode; if(kc == 13) //Enter { } else if(kc == 27) //Esc { } else { //Resize TextArea To Input var width = 50 + (_txtArea.val().length*10); _txtArea.css("width", width+"px"); } }); }); //End Each JQ Element }; //End autoCompleteEx() //Private Functions function junk() { }; //Public Functions $.fn.autoCompleteEx.addItem = function(id,txt) { var x = this; var y = 0; }; //Default Settings $.fn.autoCompleteEx.defaults = { minChars: 2, delay: 300, maxItems: 1 }; //End Of Closure })(jQuery);

    Read the article

  • Many to many table design question

    - by user169867
    Originally I had 2 tables in my DB, [Property] and [Employee]. Each employee can have 1 "Home Property" so the employee table has a HomePropertyID FK field to Property. Later I needed to model the situation where despite having only 1 "Home Property" the employee did work at or cover for multiple properties. So I created an [Employee2Property] table that has EmployeeID and PropertyID FK fields to model this many 2 many relationship. Now I find that I need to create other many-to-many relationships between employees and properties. For example if there are multiple employees that are managers for a property or multiple employees that perform maintenance work at a property, etc. My questions are: 1) Should I create seperate many-to-many tables for each of these situations or should I just create 1 more table like [PropertyAssociatonType] that lists the types of associations an emploee can have with a property and just add a FK field to [Employee2Property] such a PropertyAssociationTypeID that explains what the association is? I'm curious about the pros/cons or if there's another better way. 2) Am I stupid and going about this all worng? Thanks for any suggestions :)

    Read the article

  • How to use a dialog in an Excel shared addin

    - by user169867
    I'm writing a shared addin for Excel. It adds a CommandBarButton that when clicked opens a WPF window to collect some information from the user. I wanted to keep the same WPF dialog in memory and reuse it so that if the user clicks the CommandBarButton again their previous values would still be there. So I made a reference to my WPD as a private member of my addin object that implements Extensibility.IDTExtensibility2. I created the window during OnStartupComplete(), but for some reason when I run Excel the window immediately opens even though I never called ShowDialog() and when I do call ShowDialog() when the CommandBarButton is clicked to reOpen the window it fails to load. Does anyone know why this happens and what the correct way to handle this is? Thanks very much for any help.

    Read the article

  • Can I clone an IQueryable in linq? For UNION purposes?

    - by user169867
    I have a table of WorkOrders. The table has a PrimaryWorker & PrimaryPay field. It also has a SecondaryWorker & SecondaryPay field (which can be null). I wish to run 2 very similar queries & union them so that it will return a Worker Field & Pay field. So if a single WorkOrder record had both the PrimaryWorker and SecondaryWorker field populated I would get 2 records back. The "where clause" part of these 2 queries is very similar and long to construct. Here's a dummy example var q = ctx.WorkOrder.Where(w => w.WorkDate >= StartDt && w.WorkDate <= EndDt); if(showApprovedOnly) { q = q.Where(w => w.IsApproved); } //...more filters applied Now I also have a search flag called "hideZeroPay". If that's true I don't want to include the record if the worker was payed $0. But obviously for 1 query I need to compare the PrimaryPay field and in the other I need to compare the SecondaryPay field. So I'm wondering how to do this. Can I clone my base query "q" and make a primary & secondary worker query out of it and then union those 2 queries together? I'd greatly appreciate an example of how to correctly handle this. Thanks very much for any help.

    Read the article

  • Better performance to Query the DB or Cache small result sets?

    - by user169867
    Say I need to populate 4 or 5 dropdowns w/ items from a database. Each drop down will have < 15 items in it. These items almost never change. Now I could query the DB each time the page is accessed or I could grab the values from a custom class that would check to see if they already exist in ASP.Net's cache and only if they don't query the DB to update the cache. It's trivial for me to write but I'm unsure if the performace would be better or not. I think it would be (although not likely anything huge). What do you think?

    Read the article

  • Is it OK to allow users to query an OLTP SQL Server database with excel?

    - by user169867
    I have a SQL Server 2005 database used by several applications. Some users wish to query the database directly from excel. I can understand this, because it is a useful tool for adhoc queries and then getting the data in a format that's easily transmitted and manipulated by other users. My question is: Does Excel (say 2003/2007) do its querying in a way that won't cause concurency issues? Or is it done in such a way that a seperate datawarehouse database needs to be made to handle this scenario? Thanks for any advise.

    Read the article

  • Can you specify if aspnet_compiler.exe creates a debug or release build?

    - by user169867
    I wish to compile my asp.net MVC application using aspnet_compiler.exe from the comandline to speed up cold startup. I'm wondering how it determines if it should do a release or debug build. Is it always release? Does it depend on what the web.config file says when you run aspnet_compiler.exe? What happens to an application that's been compiled w/ aspnet_compiler.exe if someone changed the bug attribute in the web.config file after it has been published? Any clarification on this would be greatly appreciated.

    Read the article

  • What's currently the best way to extend Excel using C#?

    - by user169867
    I have the professional versions of VS2008 & VS2010. I wish to add a couple buttons to a toolbar in Excel. When they are clicked I'd like to be able to open a form (either WinForms or WPF is fine) collect a few values from the user in the form and then take that data + read cell values from the current worksheet to perform some database operations. What's currently the best way to do this using C#? I'd greatly appreciate a pointer to any examples / tutorials. My understanding is that VS2010 has improved the process alot but I may have to deal w/ Excel 2003 which I don't think it supports. I get confused between Visual Studio 2008s Extensibility-Shared Addin template and other Office Addin templates I've seen. I'm not sure when which type of solution is appropriate. I'm new to Office development so I'd really appreciate any help to get me going on the right track. Thanks much.

    Read the article

  • how to populate an entity you have extended in the Entity Framework?

    - by user169867
    I have an entity in my EDMX that I've extended with a few fields in a partial class like this: public partial class Employee { public string JobName {get;set;} } These properties are for display only. In the above example say the entity has a JobTypeID property. I wish JobName to be populated w/ the name that belongs to that JobTypeID. Is there anyway to query the employee record in EF including the value for the JobName property w/o explicity assigning each field using select()? The reason I ask is that there are a lot of fields in the Employee entity so I'd like to be able to take advantage of something like: ctx.Employees.Where(e=>e.EmployeeID==employeeID).Single() ...add somehow fill in JobName too Is this possible?

    Read the article

  • How to deal with large result sets with Linq to Entities?

    - by user169867
    I have a fairly complex linq to entities query that I display on a website. It uses paging so I never pull down more than 50 records at a time for display. But I also want to give the user the option to export the full results to Excel or some other file format. My concern is that there could potentially be a large # of records all being loaded into memory at one time to do this. Is there a way to process a linq result set 1 record at a time like you could w/ a datareader so only 1 record is really being kept in memory at a time? I'd appreciate any help. Thanks

    Read the article

  • How to have an excel addin read rows from a worksheet until no more data?

    - by user169867
    I've started writing a Com addin for Excel 2003 using C#. I'm looking for a code example showing how to read in cell data from the active worksheet. I've seen that you can write code like this: Excel.Range firstCell = ws.get_Range("A1", Type.Missing); Excel.Range lastCell = ws.get_Range("A10", Type.Missing); Excel.Range worksheetCells = ws.get_Range(firstCell, lastCell); to grab a range of cells. What I could use help with is how to read the cell data when you don't know how many rows of data there are. I may be able to determine the starting row that the data will be begin at, but there will be an unkown number of rows of data to read. Could someone provide me w/ an example of how to read rows from the worksheet until you come across a row of empty cells? Also does anyone know how to grab the range of cells the user has selected? Any help would be greatly appreciated. This seems like a powerful dev tool, but I'm having trouble finding detailed documentation to help me learn it :)

    Read the article

1