Search Results

Search found 59118 results on 2365 pages for 'data persistence'.

Page 72/2365 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Possible Data Execution Prevention (DEP) problem in Windows 7

    - by Joel in Gö
    I have a serious problem with my .Net program. It calls a native dll, and then crashes instantly because it can't find a native method. This is behaviour we have seen before, whereby the C# compiler, in its infinite wisdom, sets the flag that the program is DEP compatible, even if it calls a native dll which patently is not. We have the standard workaround for this, where the flag is set to Not DEP Compatible in a post-build step, and this works fine. Everywhere except on my machine. I have Windows 7 32bit, and the program works fine on the Win 7 64bit machines that we have, as well as on Vista and XP; we have not yet been able to check on another Win7 32bit. However, on my machine the DataExecutionPolicy_SupportPolicy is 0, i.e. we have successfully switched DEP off. Does anyone know whether there is some situation in which it can still act? Or any other mechanism which could have the same effect? The dll in question also works fine when called from a native program. We are running out of ideas... any help would be much appreciated!

    Read the article

  • Sorting GridView Formed With Data Set

    - by nani
    Following Code is for Sorting GridView Formed With DataSet Source: http://www.highoncoding.com/Articles/176_Sorting_GridView_Manually_.aspx But it is not displaying any output. There is no problem in sql connection. I am unable to trace the error, please help me. Thank You. public partial class _Default : System.Web.UI.Page { private const string ASCENDING = " ASC"; private const string DESCENDING = " DESC"; private DataSet GetData() { SqlConnection cnn = new SqlConnection("Server=localhost;Database=Northwind;Trusted_Connection=True;"); SqlDataAdapter da = new SqlDataAdapter("SELECT TOP 5 firstname,lastname,hiredate FROM EMPLOYEES", cnn); DataSet ds = new DataSet(); da.Fill(ds); return ds; } public SortDirection GridViewSortDirection { get { if (ViewState["sortDirection"] == null) ViewState["sortDirection"] = SortDirection.Ascending; return (SortDirection)ViewState["sortDirection"]; } set { ViewState["sortDirection"] = value; } } protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { string sortExpression = e.SortExpression; if (GridViewSortDirection == SortDirection.Ascending) { GridViewSortDirection = SortDirection.Descending; SortGridView(sortExpression, DESCENDING); } else { GridViewSortDirection = SortDirection.Ascending; SortGridView(sortExpression, ASCENDING); } } private void SortGridView(string sortExpression, string direction) { // You can cache the DataTable for improving performance DataTable dt = GetData().Tables[0]; DataView dv = new DataView(dt); dv.Sort = sortExpression + direction; GridView1.DataSource = dv; GridView1.DataBind(); } } aspx page asp:GridView ID="GridView1" runat="server" AllowSorting="True" OnSorting="GridView1_Sorting" /asp:GridView

    Read the article

  • Core Data Relationship problem

    - by awattar
    I have a very simple model with two objects: Name and Category. One Name can be in many Categories (it's one way relationship). I'm trying to create 8 Categories every with 8 Names. Example code: NSMutableArray *localArray = [NSMutableArray arrayWithObjects: [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g1", @"Name", @"g1", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g2", @"Name", @"g2", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g3", @"Name", @"g3", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g4", @"Name", @"g4", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g5", @"Name", @"g5", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g6", @"Name", @"g6", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g7", @"Name", @"g7", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"g8", @"Name", @"g8", @"Icon", [NSNumber numberWithBool:YES] , @"Male", nil], nil]; NSMutableArray *localArray2 = [NSMutableArray arrayWithObjects: [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test1", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test2", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test3", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test4", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test5", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test6", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test7", @"Name", nil], [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test8", @"Name", nil], nil]; NSError *error; NSManagedObjectContext *moc = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; for(NSMutableDictionary *item in localArray) { NSManagedObject *category = [NSEntityDescription insertNewObjectForEntityForName:@"Category" inManagedObjectContext:managedObjectContext]; [category setValue:[item objectForKey:@"Name"] forKey:@"Name"]; [category setValue:[item objectForKey:@"Icon"] forKey:@"Icon"]; [category setValue:[item objectForKey:@"Male"] forKey:@"Male"]; for(NSMutableDictionary *item2 in localArray2) { NSManagedObject *name = [NSEntityDescription insertNewObjectForEntityForName:@"Name" inManagedObjectContext:managedObjectContext]; [name setValue:[item2 objectForKey:@"Name"] forKey:@"Name"]; [[name mutableSetValueForKey:@"CategoryRelationship"] addObject:category]; } } [moc save:&error]; And here's a problem - i've checked that 8 Categories are saved, 64 Names are saved but only 8 from all Names are connected with any category. So when i query for Names in Categories [NSPredicate predicateWithFormat:@"CategoryRelationship.@count != 0"] there are 8 elements and when [NSPredicate predicateWithFormat:@"CategoryRelationship.@count = 0"] there are 56 elements. What is going one here?

    Read the article

  • iPhone: Core Data: Updating a pre-filled database in future app versions.

    - by Cuzog
    I am creating an app with a database of information that needs to be pre-filled. This data will change in future versions. In the same database, I also need to store user editable information since that user edited data directly relates to the pre-filled data. My question is, if I'm pre-filling the database by creating a duplicate data model in a second app and copying over the core data file before release, how would I handle updates to that data in future versions of the app without destroying the user's existing data? Do the core data migration methods handle this, or must I write custom methods to programatically handle the merge at first app launch?

    Read the article

  • ASP.net displaying data from SQL data source

    - by c11ada
    hey all, im using linq2SQL to grab information from my SQL database, i have a gridview which shows all the top level information, in this case a list of groups (i.e admin, users and so on) when a user clicks say the admin group, i want to be able to show each member in that group, i have the following code which grabs the information from the database, DataClassesDataContext dc = new DataClassesDataContext(); GridViewRow row = GridView1.SelectedRow; var query1 = from p in dc.Users where p.groups.GroupID == Int32.Parse(row.Cells[1].Text) select new { p.Name, p.Address, p.Contact Number, p.Bio, }; i no i can use gridview again to display the results of the query, but this doesnt really look nice as it shows too much information at one, how would i go about having some sort of display which will show just one user at a time giving me the chance to click next and back ? thanks

    Read the article

  • Core Data and many Entity

    - by mr.octobor
    I'm newbie and I must save "Ranking" and "Level" of user. I create file Ranking.xcdatamodel for save "Ranking" with entity name Ranking (property is Rank, Name) I can save and show it. but when I create entity Level (property is CurrentLevel) my program is crash and show this message Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 UserInfo=0x60044b0 "Operation could not be completed. (Cocoa error 134100.)", { metadata = { NSPersistenceFrameworkVersion = 248; NSStoreModelVersionHashes = { Users = ; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( ); NSStoreType = SQLite; NSStoreUUID = "41225AD0-B508-4AA7-A5E2-15D6990FF5E7"; "_NSAutoVacuumLevel" = 2; }; reason = "The model used to open the store is incompatible with the one used to create the store"; } I don't know how to save "Level" please suggest me.

    Read the article

  • how to find maximum frequent item sets from large transactional data file

    - by ANIL MANE
    Hi, I have the input file contains large amount of transactions like Transaction ID Items T1 Bread, milk, coffee, juice T2 Juice, milk, coffee T3 Bread, juice T4 Coffee, milk T5 Bread, Milk T6 Coffee, Bread T7 Coffee, Bread, Juice T8 Bread, Milk, Juice T9 Milk, Bread, Coffee, T10 Bread T11 Milk T12 Milk, Coffee, Bread, Juice i want the occurrence of every unique item like Item Name Count Bread 9 Milk 8 Coffee 7 Juice 6 and from that i want an a fp-tree now by traversing this tree i want the maximal frequent itemsets as follows The basic idea of method is to dispose nodes in each “layer” from bottom to up. The concept of “layer” is different to the common concept of layer in a tree. Nodes in a “layer” mean the nodes correspond to the same item and be in a linked list from the “Head Table”. For nodes in a “layer” NBN method will be used to dispose the nodes from left to right along the linked list. To use NBN method, two extra fields will be added to each node in the ordered FP-Tree. The field tag of node N stores the information of whether N is maximal frequent itemset, and the field count’ stores the support count information in the nodes at left. In Figure, the first node to be disposed is “juice: 2”. If the min_sup is equal to or less than 2 then “bread, milk, coffee, juice” is a maximal frequent itemset. Firstly output juice:2 and set the field tag of “coffee:3” as “false” (the field tag of each node is “true” initially ). Next check whether the right four itemsets juice:1 be the subset of juice:2. If the itemset one node “juice:1” corresponding to is the subset of juice:2 set the field tag of the node “false”. In the following process when the field tag of the disposed node is FALSE we can omit the node after the same tagging. If the min_sup is more than 2 then check whether the right four juice:1 is the subset of juice:2. If the itemset one node “juice:1” corresponding to is the subset of juice:2 then set the field count’ of the node with the sum of the former count’ and 2 After all the nodes “juice” disposed ,begin to dispose the node “coffee:3”. Any suggestions or available source code, welcome. thanks in advance

    Read the article

  • Session persistence problem

    - by YsoL8
    Hello I'm having a problem with getting sessions to persist, and having no luck searching, I need to ask. I can access the contents of my session as expected when first set, but as soon as the page refreshes I lose everything and I don't see why. session_start() is set and I'm not unseting or destroying anything. I looked at PHP Info under sessions and everything looks ok (but my understanding of sessions is limited). I'm running MAMP on OS 10.5, and the last time I used sessions they worked.

    Read the article

  • JPA One To Many Relationship Persistence Bug

    - by Brian
    Hey folks, I've got a really weird problem with a bi-directional relationship in jpa (hibernate implementation). A User is based in one Region, and a Region can contain many Users. So...relationship is as follows: Region object: @OneToMany(mappedBy = "region", fetch = FetchType.LAZY, cascade = CascadeType.ALL) public Set<User> getUsers() { return users; } public void setUsers(Set<User> users) { this.users = users; } User object: @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) @JoinColumn(name = "region_fk") public Region getRegion() { return region; } public void setRegion(Region region) { this.region = region; } So, the relationship as you can see above is Lazy on the region side, ie, I don't want the region to eager load all the users. Therefore, I have the following code within my DAO layer to add a user to an existing user to an existing region object... public User setRegionForUser(String username, Long regionId){ Region r = (Region) this.get(Region.class, regionId); User u = (User) this.get(User.class, username); u.setRegion(r); Set<User> users = r.getUsers(); users.add(u); System.out.println("The number of users in the set is: "+users.size()); r.setUsers(users); this.update(r); return (User)this.update(u); } The problem is, when I run a little unit test to add 5 users to my region object, I see that the region.getUsers() set always stays stuck at 1 object...somehow the set isn't getting added to. My unit test code is as follows: public void setUp(){ System.out.println("calling setup method"); Region r = (Region)ManagerFactory.getCountryAndRegionManager().get(Region.class, Long.valueOf("2")); for(int i = 0; i<loop; i++){ User u = new User(); u.setUsername("username_"+i); ManagerFactory.getUserManager().update(u); ManagerFactory.getUserManager().setRegionForUser("username_"+i, Long.valueOf("2")); } } public void tearDown(){ System.out.println("calling teardown method"); for(int i = 0; i<loop; i++){ ManagerFactory.getUserManager().deleteUser("username_"+i); } } public void testGetUsersForRegion(){ Set<User> totalUsers = ManagerFactory.getCountryAndRegionManager().getUsersInRegion(Long.valueOf("2")); System.out.println("Expecting 5, got: "+totalUsers.size()); this.assertEquals(5, totalUsers.size()); } So the test keeps failing saying there is only 1 user instead of the expected 5. Any ideas what I'm doing wrong? thanks very much, Brian

    Read the article

  • binary search and trio

    - by user121196
    given a large list of alphabetically sorted words in a file,I need to write a program that, given a word x, determines if x is in the list. priorties: 1. speed. 2. memory I already know I can use (n is number of words, m is average length of the words) 1. a tri, time is O(log(n)), space(best case) is O(log(n*m)), space(worst case) is O(n*m). 2. load the complete list into memory, then binary search, time is O(log(n)), space is O(n*m) I'm not sure about the complexity on tri, please correct me if they are wrong. Also are there other good approaches?

    Read the article

  • Can't find my bug: Group flat data in Advanced Datagrid w'ont work

    - by Werner
    Hi, i've got an ArrayCollection which is properly displayed in this Advanced Datagrid: <mx:AdvancedDataGrid id="drawingDataDG" editable="true" sortableColumns="true" headerWordWrap="true" sortExpertMode="true" rowCount="8" y="10" right="10" left="10" dataProvider="{model.drawingsData}"> <mx:columns> <mx:AdvancedDataGridColumn headerText="Approved in Week" dataField="ApprovedInWeek" editable="false" visible="true" /> <mx:AdvancedDataGridColumn headerText="DRAWING_PK" dataField="DRAWING_PK" editable="false" visible="false" /> <mx:AdvancedDataGridColumn headerText="Drawing No" dataField="DRAWING_NO" editable="false" visible="true"/> <mx:AdvancedDataGridColumn headerText="Drawing Index" dataField="DRAWING_INDEX" editable="false" visible="true"/> </mx:columns> ` According to this explanation link text I've implemented a GroupingCollection. But it just don't work??? <mx:AdvancedDataGrid id="drawingDataDG" editable="true" sortableColumns="true" headerWordWrap="true" sortExpertMode="true" rowCount="8" y="10" right="10" left="10" initialize="gc.refresh();"> <mx:dataProvider> <mx:GroupingCollection id="gc" source="{model.drawingsData}"> <mx:Grouping> <mx:GroupingField name="ApprovedInWeek"/> </mx:Grouping> </mx:GroupingCollection> </mx:dataProvider> <mx:columns> <mx:AdvancedDataGridColumn headerText="Approved in Week" dataField="ApprovedInWeek" editable="false" visible="true" /> <mx:AdvancedDataGridColumn headerText="DRAWING_PK" dataField="DRAWING_PK" editable="false" visible="false" /> <mx:AdvancedDataGridColumn headerText="Drawing No" dataField="DRAWING_NO" editable="false" visible="true"/> <mx:AdvancedDataGridColumn headerText="Drawing Index" dataField="DRAWING_INDEX" editable="false" visible="true"/> </mx:columns> </mx:AdvancedDataGrid> Please let me know what additional details you may need? Werner

    Read the article

  • Avoiding Duplicate Data in DB (for use with Rails)

    - by ants
    I have five tables that I am trying to get to work nicely together but may need some help. I have three main tables: accounts members and roles. With two join tables account_members and account_member_roles. The accounts and members table are joined by account_members (fk account_id and member_id) table. The other 2 tables are the problem (roles and account_member_roles). A member of an account can have more than one role and I have the account_member_roles (fk account_member_id and role_id) table joining the account_members join table and the roles table. That seems logical but can you have a relationship with a join table? What I'd like to be able to do is when creaeting an account, for instance, I would like @account.save to include the roles and update the account_member_roles table neatly ..... but through the account_members join table. I've tried ..... accept_nested_attributes_for :members, :account_member_roles in the account.rb but I get ..... ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection (Cannot modify association 'Account#account_member_roles' because the source reflection class 'AccountMemberRole' is associated to 'AccountMember' via :has_many.) upon trying to save a record. Any advice on how I should approach this? CIA -ants

    Read the article

  • How do we read the data from a public google spreadsheet using Zend_Gdata

    - by bobo
    I have read the examples here: http://framework.zend.com/manual/en/zend.gdata.spreadsheets.html But those examples assume the spreadsheet to be read needs authentication: $service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); $spreadsheetService = new Zend_Gdata_Spreadsheets($client); $feed = $spreadsheetService->getSpreadsheetFeed(); The spreadsheet I am going to read from is a public one, so I don't really need to provide any authentication right? And what I need to provide is just the url of the spreadsheet. I tried to read the class description here but still have no idea how it can be done: http://framework.zend.com/apidoc/core/Zend_Gdata/Spreadsheets/Zend_Gdata_Spreadsheets.html

    Read the article

  • As-You-Type-Searching with Core Data / NSFetchedResultsController

    - by Snej
    I implemented an as-you-type-searching (text search on single attribute) by fetching with performFetch: after each given character by the user. The performFetch: is running in a background thread to avoid keyboard freezes. But while typing many useless fetches are started. A NSOperationQueue might be an option, but I wonder if there are other approaches for this quite usual search behavior. What's best practice to notice when fetching is done and the table view is updated with the previous fetch to start a new fetch?

    Read the article

  • Recovering the deleted data from Android SD Card ?

    - by Nish
    I am trying to make an Android application which would try to recover deleted content from the SD Card. How feasible it is ? I have following method in mind: 1) Since, the files are not actually deleted, can I access the file system to see files which has been marked to be overwritten. 2) Or will I have do header/footer file carving ? Is it possible from the application layer of android ? I am concerned about files stored on contiguous sectors and not the fragmented once. I want to do a basic file retrieval. Please let me know some resources which I can use to make this application ?

    Read the article

  • Core data, sorting one-to-many child objects

    - by Shizam
    So if I have a store of parents children and the parent has a one to many relationship to children (parent.children) and they all have first names. Now, on the initial fetch for parents I can specify a sort descriptor to get them back in order of first name but how can I request the children in order? If I do a [parent.children allObjects] it just gives them back in a jumble and I'd have to sort after the fact, every time. Thanks, Sam

    Read the article

  • Core Data - Breaking A Relationship

    - by Garry
    Hi, I have a Patient entity and a List entity. A Patient can belong to several different lists and a list can have several different patients. Say I have a patient who belongs to 3 lists (A, B, C). I want to remove the patient from lists A & B. I do not want to delete lists A & B themselves though obviously. How do I go about doing this?

    Read the article

  • How do you make a Custom Data Generator for SQL XML DataType.

    - by Keith Sirmons
    Howdy, I am using Visual Studio 2010 and am playing around with the Database Projects. I am creating a DataGenerationPlan to insert data into a simple table, in which one of the column datatypes is XML. Out of the box, the generation plan uses the Regular Expression generator and generates something like this : HGcSv9wa7yM44T9x5oFT4pmBkEmv62lJ7OyAmCnL6yqXC2X.......... I am looking at creating a custom data Generator for this data type and have followed this site for the basics: http://msdn.microsoft.com/en-us/library/aa833244.aspx This example works if I am creating a string datatype and using it for a nvarchar datatype. What do I need to change to hook this Generator to the XML Datatype? Below are my code files. The string property works for nvarchar. The XElement property does not work for the xml datatype, and the RecordXMLDataGenerator is not listed as an option in the Generator column for the generation plan. CustomDataGenerators: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Data.Schema.Tools.DataGenerator; using Microsoft.Data.Schema.Extensibility; using Microsoft.Data.Schema; using Microsoft.Data.Schema.Sql; using System.Xml.Linq; namespace CustomDataGenerators { [DatabaseSchemaProviderCompatibility(typeof(SqlDatabaseSchemaProvider))] public class RecordXMLDataGenerator : Generator { private XElement _RecordData; [Output(Description = "Generates string of XML Data for the Record.", Name = "RecordDataString")] public string RecordDataString { get { return _RecordData.ToString(SaveOptions.None); } } [Output(Description = "Generates XML Data for the Record.", Name = "RecordData")] public XElement RecordData { get { return _RecordData; } } protected override void OnGenerateNextValues() { base.OnGenerateNextValues(); XElement element = new XElement("Root", new XElement("Children1", 1), new XElement("Children6", 6) ); _RecordData = element; } } } XML Extensions File: <?xml version="1.0" encoding="utf-8" ?> <extensions assembly="" version="1" xmlns="urn:Microsoft.Data.Schema.Extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:Microsoft.Data.Schema.Extensions Microsoft.Data.Schema.Extensions.xsd"> <extension type="CustomDataGenerators.RecordXMLDataGenerator" assembly="CustomDataGenerators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxx" enabled="true"/> </extensions> Table.sql: CREATE TABLE [dbo].[Record] ( id int IDENTITY (1,1) NOT NULL, recordData xml NULL, userId int NULL, test nvarchar(max) NULL, rowver rowversion NULL, CONSTRAINT pk_RecordID PRIMARY KEY (id) )

    Read the article

  • What ORM for .NET should I use?

    - by eKek0
    I'm relatively new to .NET and have being using Linq2Sql for a almost a year, but it lacks some of the features I'm looking for now. I'm going to start a new project in which I want to use an ORM with the following characteristics: It has to be very productive, I don't want to be dealing with the access layer to save or retrieve objects from or to the database, but it should allows me to easily tweak any object before actually commit it to the database; also it should allows me to work easily with a changing database schema It should allows me to extend the objects mapped from the database, for example to add virtual attributes to them (virtual columns to a table) It has to be (at least almost) database agnostic, it should allows me to work with different databases in a transparent way It has to have not so much configuration or must be based on conventions to make it work It should allows me to work with Linq So, do you know any ORM that I could use? Thank you for your help. EDIT I know that an option is to use NHibernate. This appears as the facto standard for enterprise level applications, but also it seems that is not very productive because its deep learning curve. In other way, I have read in some other post here in SO that it doesn't integrate well with Linq. Is all of that true?

    Read the article

  • Cocoa Core Data - Efficient Related Entities Counts

    - by Gary
    I am working on my first iPhone application and I've hit a wall. I'm trying to develop a 'statistics' page for a three entity relationship. My entities are the following: Department - Name, Address, Building, etc. People - Name, Gender (BOOL), Phone, etc If I have fetched a specific department how do I filter those results and only return people that are Male (Gender == 0)? If I do NSLog(@"%d", [department.people count]); I get the correct number of people in that department so I know I'm in the neighborhood. I know I could re-fetch and modify the predicate each time but with 20+ stats in my app that seems inefficient. Thanks for any advice!

    Read the article

  • DataGridView bound to a Dictionary and updated with a thread

    - by Manjoor
    I have a Dictionary binded to DataGridView by using following sample code. http://stackoverflow.com/questions/854953/datagridview-bound-to-a-dictionary Please see the above question first The diffrence is that i am updating dictionary from a thread. (Event handler of another class). My Event handler is as below static void f_PriceChanged(Objet f, eventData e) { if (prices.ContainsKey(e.ItemText)) prices[e.ItemText] = e.price; else prices.Add(e.ItemText, e.price); } Not to mention the prices is declared as class level. I have modified the button code from original post as Button btn = new Button(); btn.Dock = DockStyle.Bottom; btn.Click += delegate { bl.Reset(); }; form.Controls.Add(btn); Internally the Dictionary is updated as expected but grid does not update. Clicking on button generate exception Collection was modified; enumeration operation may not execute What to do?

    Read the article

  • Using DTOs and BOs

    - by ryanzec
    One area of question for me about DTOs/BOs is about when to pass/return the DTOs and when to pass/return the BOs. My gut reaction tells me to always map NHibernate to the DTOs, not BOs, and always pass/return the DTOs. Then whenever I needed to perform business logic, I would convert my DTO into a BO. The way I would do this is that my BO would have a have a constructor that takes a parameter that is the type of my interface (that defines the required fields/properties) that both my DTO and BO implement as the only argument. Then I would be able to create my BO by passing it the DTO in the constructor (since both with implement the same interface, they both with have the same properties) and then be able to perform my business logic with that BO. I would then also have a way to convert a BO to a DTO. However, I have also seen where people seem to only work with BOs and only work with DTOs in the background where to the user, it looks like there are no DTOs. What benefits/downfalls are there with this architecture vs always using BO's? Should I always being passing/returning either DTOs or BOs or mix and match (seems like mixing and matching could get confusing)?

    Read the article

  • Core Data => Adding a related object always nil

    - by mongeta
    Hello, I have two tables related: DataEntered and Model DataEntered -currentModel Model One DataEntered can have only ONE Model, but a Model can stay into many DataEntered. The relationship is from DataEntered to Model (No To Many-relathionship) and no inverse relation. XCode generates the setters for DataEnteredModel: @property (nonatomic, retain) NSSet * current_model; - (void)addCurrent_modelObject:(CarModel *)value; - (void)addCurrent_model:(NSSet *)value; I have a Table and when I select a model, I want to store it to DataEntered: Model *model = [fetchedResultsController objectAtIndexPath:indexPath]; NSLog(@"Model %@",model.name); // ==> gives me the correct model name [dataEntered addCurrent_modelObject:model]; // ==> always nil [dataEntered setCurrent_model:[fetchedResultsController objectAtIndexPath:indexPath]]; // the same, always nil what I'm doing wrong ????? thanks, r.

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >