Search Results

Search found 13329 results on 534 pages for 'reactive framework'.

Page 40/534 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Entity Framework query

    - by carter-boater
    Hi all, I have a piece of code that I don't know how to improve it. I have two entities: EntityP and EntityC. EntityP is the parent of EntityC. It is 1 to many relationship. EntityP has a property depending on a property of all its attached EntityC. I need to load a list of EntityP with the property set correctly. So I wrote a piece of code to get the EntityP List first.It's called entityP_List. Then as I wrote below, I loop through the entityP_List and for each of them, I query the database with a "any" function which will eventually be translated to "NOT EXIST" sql query. The reason I use this is that I don't want to load all the attached entityC from database to memory, because I only need the aggregation value of their property. But the problem here is, the looping will query the databae many times, for each EntityP! So I am wondering if anybody can help me improve the code to query the database only once to get all the EntityP.IsAll_C_Complete set, without load EntityC to memory. foreach(EntityP p in entityP_List) { isAnyNotComoplete = entities.entityC.Any(c => c.IsComplete==false && c.parent.ID == p.ID); p.IsAll_C_Complete = !isAnyNotComoplete; } Thank you very much!

    Read the article

  • Entity Framework Reusing Connection

    - by LB
    in a using block for a connection to the entities, How am I to reuse the connection when calling another method? so I have: using (SampleEntities entities = new SampleEntities()) { entities.Connection.Open(); SomeMethod(); ... } void SomeMethod() { using (SampleEntities entities = new SampleEntities()) { // I want to be able to use the existing connection before the method call, any ideas? } }

    Read the article

  • Zend Framework - validators are not working anymore?

    - by Pavel Dubinin
    Eariler I happily used the following code for creating form elements (inside Zend_Form descendant): //Set for options $this->setOptions(array( 'elements' => array( 'title' => array( 'type' => 'text', 'options' => array( 'required' => true, 'label' => 'Title', 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array('minLength'=>1, 'maxLength'=>50)), ), ) ) )); But now I've noticed that validators are not working.. I suspect this might be due to zend updates.. Does anyone face this problem?

    Read the article

  • Entity framework not loading relationship even when using include

    - by dilbert789
    I have this code: Category selectedCategory = (from c in DB.Category.Include("SubCategory") join a in DB.Accessory on c.AccCatUID equals a.Category.AccCatUID where a.AccUID == currentAccessory.AccUID select c).FirstOrDefault(); It works fine, selectedCategory gets populated as expected. BUT selectedCategory has a child table 'SubCategory' which does not get loaded even though there is the include there. It is not loaded until I do this: selectedCategory.SubCategory.Load(); Why do I have to call load explicitly in order to load the child table?

    Read the article

  • Route all requests through PageController except existing controllers (Zend Framework)

    - by ChrisRamakers
    For a new CMS i've developed a Pages module that allows me to manage the site's tree structure. Each page is reachable from the url http://www.example.com/pageslug/ where pageslug identifies the page being called. What I want to achieve now is a route that allows me to route all incoming requests to a single PagesController unless it's a request to an existing controller (like images for example). It's easy enough to catch all requests to the Pages Controller but how to exclude existing controllers? This is my module bootstrap. How can i achieve this in the most preferrable way <?php class Default_Bootstrap extends Zend_Application_Module_Bootstrap { protected function _initRoute() { $this->bootstrap('frontController'); /* @var $frontcontroller Zend_Controller_Front */ $frontcontroller = $this->getResource('frontController'); $router = $frontcontroller->getRouter(); $router->addRoute( 'all', new Zend_Controller_Router_Route('*', array('controller' => 'pages', 'action' => 'view') ) ); } }

    Read the article

  • how to Decorate the error message on zend framework

    - by ulduz114
    this is the decorator code $mydecorate = array( 'ViewHelper', array('Errors', array('placement' => 'append','class' => 'error')), array('Label', array('separator' => '')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-form')) ); html result of two input elements with the above decorator: <p class="element-form"> <label for="firstname" class="required">First Name:</label> <input name="firstname" id="firstname" value="" type="text"> </p><ul class="error"><li>required field!</li></ul> <p class="element-form"> <label for="lastname" class="required">Last Name:</label> <input name="lastname" id="lastname" value="" type="text"> </p><ul class="error"><li>required field!</li></ul> I'd like the error message to be placed inside the p.element-form tag, any idea pleas? thanks

    Read the article

  • Entity Framework Performance Inconsistency Compared to Sql Management Studio

    - by AndyV
    I'm getting timeouts with a very basic EF statement. I'm simply doing a select from a single table with a Entity.Title.StartsWith("test") and a .Take(25). When I run this for a search that returns no results I get a timeout. If I profile and grab the sql statement it looks fine, and if I run that sql in Management Studio it runs in a fraction of a second! Why would the same query run sub-second in Management Studio and timeout when generated by EF and called from an Asp.Net app?

    Read the article

  • How to raise a System KeyDown event manually in .Net Compact framework 3.5

    - by Sundar
    I have developed a custom keypad using resco controls in my application I have currently handled the backspace button click event with the following code private void customKeyboard1_KeyboardKeyUp(object sender, Resco.Controls.Keyboard.KeyPressedEventArgs e) { if (e.Key.Text == "Backspace") { Resco.Controls.Keyboard.CustomKeyboard.SendBackspace(); e.Handled = true; } } This works fine with the edit boxes in the application but not working in edit boxes in the web pages (for eg. on gmail username text box). so is there any way to raise the KeyDown event manually

    Read the article

  • Zend framework currency validation

    - by Dan
    How can I validate (a form element in this case) to ensure that the value is a currency? Have looked at Zend_Validate_Float. Needs to check that value is between 0 and 2dp. Ideally locale-aware (as ZVF is) to allow for locale specific formatting (thousands, decimal as comma/dot) Would also want to extend to allow/disallow negative values And provide optional upper/lower limits. Is the key, as I can do 3. and 4. with a chain. Do I need regex?

    Read the article

  • Which JavaScript MVC framework to use for wysiwyg editing and floating context-sensitive settings pa

    - by ernests
    I'm developing a cms that allows editing everything on the page (generated server-side with a template engine) by just clicking on it — the area turns into input field, textarea or a full-featured tinyMCE editor, Template defines editable elements like "page heading", "copyright footer text", "image", "rich text block" etc. Along with that there's always a flotaing panel with several tabs, some of which contain general settings like page bacground color, font settings etc, but some are context sensitive (e.g., the clicking on "image" editable field triggers to display uploading/cropping/captioning interface in the floating panel). All settings in the panel are either simple inputs or sliders or checkboxes. I'm new to using MVC with javascript, and in fact haven't used it much before. jQuery is used as code library for the project. Should i use JavascriptMVC, SproutCore or anything else? Does any of them allow some kind of sandboxing (within bounds of commmon sense) to allow some javascript code by user-generated skins on my cms? thank you!

    Read the article

  • Zend Framework Zend_Form Decorators: <span> Inside Button Element?

    - by leek
    I have a button element that I've created like so: $submit = new Zend_Form_Element_Button('submit'); $submit->setLabel('My Button'); $submit->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'li')) )); $submit->setAttrib('type', 'submit'); This generates the following HTML: <li> <label for="submit" class="optional">My Button</label> <button name="submit" id="submit" type="submit">My Button</button> </li> I would like to wrap the inside of the button with a <span, like this: <button...><span>My Button</span></button> What is the best way to do this using Zend_Form?

    Read the article

  • Entity framework error: The conversion of a datetime2 data type to a datetime data

    - by EdenMachine
    I know there are a ton of posts about this issue but none of them seem to solve my problem. Here's the scenario: I have a CreateDate DateTime column in my MS SQL Server database User table that is non-nullable and is automatically set using GetDate() method in "Default Value or Binding" setting. I am able to create a User just fine with the standard EF Insert but when I try to update the user, I get this error: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. What is the trick to not having the EF worry about the CreateDate column for updates? I have the StoreGenerationPattern = Identity but that isn't helping. Here are the EF properties for my Entity Property: http://screencast.com/t/8ndQRn9N And here is my Update method: http://screencast.com/t/UXIzhkhR

    Read the article

  • .NET compact framework - barcode scanner

    - by dominolog
    Hello I have Motorola MC55 with Windows Mobile 6.5 on-board. This nice palm contains also an embedded bar-code scanner. My question is - Will I need anything special in .NET CF in order to use the bar-code scanner? I would expect that the bar-code are read as normal strings and delivered as keyboard events? Is any special .NET CF library necessary? Thanks for help Dominik

    Read the article

  • Zend Framework - no public folder

    - by poru
    Hello, I'm going to host an app on a shared host and there I couldn't create virtual host or change something at apache. Often apps with ZF looks like that: root public index.php .htaccess application library I have sth. like that: root application index.php .htaccess All my code is in the application folder. But there are also some .ini and .xml files with sensitive information e.g. login names and passwords and so on... If I add a .htaccess in the application folder with deny from all is the information secure inside the folder?

    Read the article

  • Zend Framework - applying order by on a nested query

    - by Gublooo
    Hey guys This might be a very simple thing. Check out the normal sql query below (select * from shopping order by shopping_id desc limit 5) order by RAND() This query runs successfully in mysql - not sure if this is the right way of doing it - but it works. It gets the last 5 ids from shopping table and randomly orders them everytime I want to achieve this in Zend. I'm not sure how to execute the first part and then apply the RAND clause to the results - what I have below does not do that. $select = $this-select() -from(array('sh'='shopping')) -order('shopping_id desc') -limit(5) -order('RAND()');

    Read the article

  • Entity framework memory leak after detaching newly created object

    - by Tom Peplow
    Hi, Here's a test: WeakReference ref1; WeakReference ref2; TestRepositoryEntitiesContainer context; int i = 0; using (context = GetContext<TestRepositoryEntitiesContainer>()) { context.ObjectMaterialized += (o, s) => i++; var item = context.SomeEntities.Where(e => e.SomePropertyToLookupOn == "some property").First(); context.Detach(item); ref1 = new WeakReference(item); var newItem = new SomeEntity {SomePropertyToLookupOn = "another value"}; context.SomeEntities.AddObject(newItem); ref2 = new WeakReference(newItem); context.SaveChanges(); context.SomeEntities.Detach(newItem); newItem = null; item = null; } context = null; GC.Collect(); Assert.IsFalse(ref1.IsAlive); Assert.IsFalse(ref2.IsAlive); First assert passes, second fails... I hope I'm missing something, it is late... But it appears that detaching a fetched item will actually release all handles on the object letting it be collected. However, for new objects something keeps a pointer and creates a memory leak. NB - this is EF 4.0 Anyone seen this before and worked around it? Thanks for your help! Tom

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >