Search Results

Search found 13276 results on 532 pages for 'yii framework'.

Page 49/532 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • Entity framework 4.0 compiled query with Where() clause issue

    - by Andrey Salnikov
    Hello, I encountered with some strange behavior of System.Data.Objects.CompiledQuery.Compile function - here is my code for compile simple query: private static readonly Func<DataContext, long, Product> productQuery = CompiledQuery.Compile((DataContext ctx, long id) => ctx.Entities.OfType<Data.Product>().Where(p => p.Id == id) .Select(p=>new Product{Id = p.Id}).SingleOrDefault()); where DataContext inherited from ObjectContext and Product is a projection of POCO Data.Product class. My data context in first run contains Data.Product {Id == 1L} and in second Data.Product {Id == 2L}. First using of compilled query productQuery(dataContext, 1L) works perfect - in result I have Product {Id == 1L} but second run productQuery(dataContext, 2L) always returns null, instead of context in second run contains single product with id == 2L. If I remove Where clause I will get correct product (with id == 2L). It seems that first id value caching while first run of productQuery, and therefore all further calls valid only when dataContext contains Data.Product {id==1L}. This issue can't be reproduced if I've used direct query instead of its precompiled version. Also, all tests I've performed on test mdf base using SQL Server 2008 express and Visual studio 2010 final from my ASP.net application.

    Read the article

  • Integration framework for PHP

    - by borobax
    Please suggest some articles, implementations or other resources that deal with making generic customizable integration interfaces(csv+xml-rpc,soap,custom xml) for existing PHP applications. Thanks!

    Read the article

  • Enumerable.Range in and Expression and Entity Framework

    - by eka808
    I'm currently developping an expression method (used in linq to entity queries) who has to give me a daycount for a given period (start date and end date) decrementing this daycount if specials days are in the period. My idea was the following : Generate an enumerable with all the dates (and with Enumerable.Range) Make a .Where on this enumerable to remove the specials dates Like a MyEnumerable.Where(a = a != "20120101") After that, return a MyEnumerable.Count() I come with this code : return (p) => Enumerable .Range(1, 4) .Where(a => a != 20120101) .AsQueryable() .Count() I tried to cast as a list, as a queryable, both (like the example) and no way ! it doesn't work ! I always get this error : LINQ to Entities does not recognize the method 'System.Collections.Generic.IEnumerable`1[System.Int32] Range(Int32, Int32)' method, and this method cannot be translated into a store expression. Have you got an idea about that ? Using an enumerable is of course not mandatory, any working solutions is good ^^ Thank's by advance !

    Read the article

  • Zend Framework: View variable in layout script is always null

    - by understack
    I set a view variable in someAction function like this: $this->view->type = "some type"; When I access this variable inside layout script like this: <?php echo $this->type ?> it prints nothing. What's wrong? My application.ini settings related to layout resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.layout.layout = "layout" ; changed 'default' to 'layout'

    Read the article

  • Simple python mvc framework

    - by Overdose
    Is there any lightweight mvc webframework which is not necessary to install to the server? I need something simple, that i could just copy to the shared hosting. And it must handle urls other that localhost/test.py, something like this localhost/Blog/test

    Read the article

  • Zend Framework: How to display multiple actions, each requiring different authorizations levels, on

    - by Iain
    Imagine I have 4 database tables, and an interface that presents forms for the management of the data in each of these tables on a single webpage (using the accordion design pattern to show only one form at a time). Each form is displayed with a list of rows in the table, allowing the user to insert a new row or select a row to edit or delete. AJAX is then used to send the request to the server. A different set of forms must be displayed to different users, based on the application ACL. My question is: In terms of controllers, actions, views, and layouts, what is the best architecture for this interface? For example, so far I have a controller with add, edit and delete actions for each table. There is an indexAction for each, but it's an empty function. I've also extended Zend_Form for each table. To display the forms, I then in the IndexController pass the Forms to it's view, and echo each form. Javascript then takes care of populating the form and sending requests to the appropraite add/edit/delete action of the appropriate controller. This however doesn't allow for ACL to control the display or not of Forms to different users. Would it be better to have the indexAction instantiate the form, and then use something like $this-render(); to render each view within the view of the indexAction of the IndexController? Would ACL then prevent certain views from being rendered? Cheers.

    Read the article

  • Zend framework forms, upload file problem

    - by bounce
    Hi, I use Zend forms in my web application. I wonder where Zend puts uploded temp file by default ? I can't find it in server tmp dir. For example if I upload image(1.jpg) via file field, it appears on tmp folder, but as 1.jpg(/tmp/1.jpg). But I need temporary file like /tmp/phpeZApBn. Maybe it is in any other location ? Any help would be appreciated.

    Read the article

  • Replace Entity Framework object

    - by majkinetor
    In MVC app, I am having this big object that is used in classic view/edit/create pattern. When user edits the object I save it as: public bool SetMyObject(MyObject newObject) { MyObject current = GetObjectById(newObject.Id); current.Prop1 = newObject.Prop1 ... current.PropN = newObject.PropN db.SaveChanges(); } MyObject is pretty big so I am wondering is there any better way to do this, not involving per-property assignments. For instance something along the lines db.MyObject.UpdateObject(current, tnew). Ty.

    Read the article

  • Association in Entity Framework 4

    - by Marsharks
    I have two tables, a problem table and a problem history table. As you can expect, a problem can have many histories associated with it. CREATE TABLE [dbo].[Problem]( [Last_Update] [datetime] NULL, [Problem_Id] [int] NOT NULL, [Incident_Count] [int] NULL ) ALTER TABLE [dbo].[Problem] ADD CONSTRAINT [PK_Problem] PRIMARY KEY CLUSTERED ( [Problem_Id] ASC ) CREATE TABLE [dbo].[Problem_History]( [Last_Update] [datetime] NULL, [Problem_Id] [int] NOT NULL, [Severity_Chg_Flag] [char](1) NULL ) ALTER TABLE [dbo].[Problem_History] ADD [Create_DateTime] [datetime] NOT NULL ALTER TABLE [dbo].[Problem_History] WITH CHECK ADD CONSTRAINT [FK_Problem_History_Problem] FOREIGN KEY([Problem_Id]) REFERENCES [dbo].[Problem] ([Problem_Id]) The problem is when I drag this into an Entity Model, the associations are not included. Any ideas? I would like to point out that the problem history table has no separate key of its own, it shares the problem id

    Read the article

  • Query Entity Framework 4

    - by nick
    Hi, Is it possible to run a query on an EF4.0 data context and get all objects of a certain type? Say the context has books, genres & authors but I only have a generic parameter, t. Is it possible to get all of type just by using this t? I don't think it is :(

    Read the article

  • session set for some Actions in Zend framework

    - by user202127
    I'm working on a website , in CV part users have some articles that only logged in users can download them.I want to make changes to the log in Action or preDispatch() to set session for guess users to download the articles, can some one tell me how it can be or give me some reference links. here is my preDispatch(): public function preDispatch() { $userInfo=$this->_auth->getStorage()->read(); $identity= $this->_auth->getIdentity(); if(!$this->_auth->hasIdentity()) { return $this->_helper->redirector('login','login'); } if(!isset($userInfo["member_id"]) || strlen($userInfo["member_id"])==0) { return $this->_helper->redirector('forbidden','login'); } $this->_accessType=2; }

    Read the article

  • Zend Framework in a subfolder, but images taken from site root

    - by Pentium10
    I have a dev project setup in a subfolder on my testing machine and it must stay there. However all the Zend frameworks views are linked to server root. CSS are linked like: <link type="text/css" href="<?php echo $this->baseUrl('/css/frontend.css') ?>" rel="Stylesheet" /> Which must be stayed this way, but it should link to localhost/a/b/c/prj1/css/frontend.css How can I setup a global subdirectory for this?

    Read the article

  • Zend Framework: How do I modify/format the form view generated with Zend_Dojo_Form elements

    - by pinardelrio
    I have created a form: <?php class Application_Form_Issue extends Zend_Dojo_Form { public function init() { $this->setName('issue'); $this->setMethod('post'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $date_recvd = new Zend_Dojo_Form_Element_DateTextBox('date_recvd'); $date_recvd->setLabel('Date Received') //->setRequired(true) /*->addValidator('NotEmpty'); */; More Form elements ... To view this form my view script is: <?php echo $this->form; ?> This all works just fine, with fully functional dojo form elements (datepicker, timepicker, etc) and successfully saving the data. However, now, I want to format the form that is generated with css. Such as grouping some elements and floating left or right, making some input text fields wider/narrower, etc. How? I realize I can modify the view script but it seems like that defeats the purpose of using Zend_Dojo_Form or Zend_Form. Is that a correct assumption?

    Read the article

  • Entity Framework 4 omits some associations during model generation

    - by kzen
    After creating an EF4 model from a SQL Server database I noticed that all the relationships of my Users table were not imported into the model as associations. All the other relationships were imported fine. My Users table has a PK userId which is a char(7) field and it is integrated into several other tables in the database as an FK but for some reason EF4 does not import these relationships as associations during the model generation process... Does anyone have any ideas why this would be happening?

    Read the article

  • Entity Framework Create Database & Tables At Runtime

    - by dhsto
    I created some tables in an .edmx file and have been generating the database by selecting "Generate Database From Model" and manually executing an .edmx.sql file on the database to build the tables. Now, however, I am creating a setup dialog that allows the user to connect the program up to their own database. I thought running context.CreateDatabase would be good enough to create the database, along with the tables, but the tables are not created. What is the preferred method for creating the database and tables when the user specifies their own server and database to use, when originally starting with a model?

    Read the article

  • Delete database. Entity Framework

    - by Idotz
    I have a very annoying issue and I would love a solution. The problem: I followed the MDSN tutorial- http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model Then I tried this guide according to my needs and I set up a database GAMES.MDF.   Then, I deleted the database and set it up again, is supposedly work (I can write and read data), but There is no such database in the APP_DATA folder. Like it keeps it somewhere in my PC and reuse it.   I even tried a new project and it did not work, works but not in the library, and it even uses the data I created before. I even deleted the DB from SQL Server Management Studio 2008. Does anyone know what the hell? How do I delete it permanently, not to remain any trace of him?   Thank you.  Ido

    Read the article

  • How to set the session timeout in Zend Framework 2

    - by user2261761
    I don't have much Zend experience and want to change someone's login code in Zend to make the session not expire. It seems the code is basic behavior: $adapter = $this->getAuthService()->getAdapter(); $adapter->setIdentity($email)->setCredential($password); $result = $this->getAuthService()->authenticate(); What do I have to do to make the session not expire or to at least set the session for a specific time? Right now the user doesn't stay logged in for long, I think perhaps it is just relying on default php settings behavior like the standard 24 minutes for the gc_maxlifetime. What is the connection between Zend_Session and AuthService?

    Read the article

  • Entity Framework: a proxy collection for displaying a subset of data

    - by Jefim
    Imagine I have an entity called Product and a repository for it: public class Product { public int Id { get; set; } public bool IsHidden { get; set; } } public class ProductRepository { public ObservableCollection<Product> AllProducts { get; set; } public ObservableCollection<Product> HiddenProducts { get; set; } } All products contains every single Product in the database, while HiddenProducts must only contain those, whose IsHidden == true. I wrote the type as ObservableCollection<Product>, but it does not have to be that. The goal is to have HiddenProducts collection be like a proxy to AllProducts with filtering capabilities and for it to refresh every time when IsHidden attribute of a Product is changed. Is there a normal way to do this? Or maybe my logic is wrong and this could be done is a better way?

    Read the article

  • Why use Entity Framework over Linq2SQL if...

    - by Refracted Paladin
    To be clear, I am not asking for a side by side comparision which has already been asked Ad Nauseum here on SO. I am also Not asking if Linq2Sql is dead as I don't care. What I am asking is this.... I am building internal apps only for a non-profit organization. I am the only developer on staff. We ALWAYS use SQL Server as our Database backend. I design and build the Databases as well. I have used L2S successfully a couple of times already. Taking all this into consideration can someone offer me a compelling reason that I should use EF instead of L2S? I was at Code Camp this weekend and after an hour long demonstration on EF, all of which I could have done in L2S, I asked this same question. The speakers answer was, "L2S is dead..." Very well then! NOT! (see here) I understand EF is what MS WANTS us to use in the future(see here) and that it offers many more customization options. What I can't figure out is if any of that should, or does, matter for me in this environment. One particular issue we have here is that I inherited the Core App which was built on 4 different SQL Data bases. L2S has great difficulty with this but when I asked the aforementioned speaker if EF would help me in this regard he said "No!"

    Read the article

  • Zend Framework additional Get params with NGINX

    - by Johni
    I configured my NGINX for Zend in the following way (PHP 5.3 with fpm): server { root /home/page/public/; index index.php index.html index.htm; server_name localhost; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } } Now i want to process additional get params like: http://web.site/index?par=1 WIth my local dev system (Apache) it works fine but not under NGINX which did'T deliver the get params. Anny suggestions? Edit: Now i use the following config which seems to work but i'm not happy with it since everybody suggests "use try_files whenever possible". location / { if (!-e $request_filename) { rewrite /(.*)$ /index.php?q=$1 last; break; } }

    Read the article

  • possible to make codeigniter work with another framework?

    - by ajsie
    the situation is this. my client (who also is a programmer) asks me to develop an address book (with mysql database) with a lot of functions. then he can interact with some class methods i provide for him. kinda like an API. the situation is that the address book application is getting bigger and bigger, and i feel like its way better to use CodeIgniter to code it with MVC. i wonder if i can use codeigniter, then in some way give him the access to controller methods. eg. in a controller there are some functions u can call with the web browser. public function create_contact($information) {..} public function delete_contact($id) {..} public function get_contact($id) {..} however, these are just callable from web browser. how can i let my client have access to these functions like an API? then in his own application he can use: $result = $address_book-create_contact($information); if($result) { echo "Success"; } $contact = $address_book-get_contact($id); is this possible? cause i just know how to access the controller methods with the webbrowser. and i guess its not an option for him to use header(location) to access them. all suggestions to make this possible are welcomed! thanks

    Read the article

  • Entity Framework: Attached Entities not Saving

    - by blog
    Hello: I can't figure out why calling SaveChanges() on the following code results in no changes to the objects I attached: // delete existing user roles before re-attaching if (accountUser.AccountRoles.Count > 0) { foreach (AccountRole role in accountUser.AccountRoles.ToList()) { accountUser.AccountRoles.Remove(role); } } // get roles to add List<int> roleIDs = new List<int>(); foreach (UserRole r in this.AccountRoles) { roleIDs.Add(r.RoleID); } var roleEntities = from roles in db.AccountRoles where roleIDs.Contains(roles.id) select roles; accountUser.AccountRoles.Attach(roleEntities); db.SaveChanges(); In the debugger, I see that the correct roleEntities are being loaded, and that they are valid objects. However, if I use SQL Profiler I see no UPDATE or INSERT queries coming in, and as a result none of my attached objects are being saved.

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >