Search Results

Search found 2484 results on 100 pages for 'maintain'.

Page 8/100 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • is it possible for a host to maintain a tcp connection with two hosts with the same IP?

    - by wenzi
    I have two hosts A and B and a host(called client here) C C will establish a tcp connection with A, and send http requests to A then A will relay the HTTP requests to B (the relaying may be seconds of delay) and B will spoof its IP address as the IP of A and send http response to C I know there is sequnce number inconsistency problem, but is it possible to trick the TCP protocol to make the connection viable? thanks!

    Read the article

  • How to maintain original figure numbers in pdf document saved from Word 2007 file?

    - by S_H
    I have a Word 2007 document in which the Figure numbers and List of Figures is correct i.e. exactly as I want. I generate a pdf (Adobe Reader X, Version 10.1.2) from Word 2007 document using the save as option. The List of Figures in the pdf document comes out exactly as present in the Word document, however when I click on that Figure number I see a different number than present in List of Figures. For example, I have this Figure number on List of Figures which is exactly as I want: But the corresponding Figure on Page 61 shows following number: It is becoming 4-21 from 4-7 because the total number of Figures from Chapters 1 till this Figure are 20. However, I want break in number of Figures between each Chapter i.e. Figures for Chapter 4 should start from 4-1, so the number 4-21 is actually 4-7 in that case. How can I correct this? Thanks.

    Read the article

  • I just received a complaint from a user of the website I maintain. Should I do anything?

    - by Chris
    I was sent sent a large wall of text from a user of the website I maintain at my job. They are clearly upset for having to deal with a horribly outdated web application that has not seen any serious updates in over 6+ years. No refactoring has been done, the code quality is terrible, the security unchecked, policy compliances ignored, in addition to being ugly and frankly embarrassing. Keep in mind this is a small business but the website is used by hundreds daily. I'm one of two programmers there, and I've been working there for two years. This person says they are about my age (22) and understand technology (but can't use proper grammar). The complaint mentioned awkward pages and actions on the website, but they don't even have a clue as to the depth of the flaws in this website. Now, I would love to honestly tell them that there's a lot wrong with this company and that this application was built when we were in high school. And that while it's not my fault that the website is terrible, I'm the one in position to fix it. But on the other hand, I could just say nothing and ignore it. Would doing this publicly have any advantage to future employees (showing integrity) or would it just be a completely pointless mistake? Odds are, even if I respond only that one person will ever read it. Regardless, I'm probably just going to ignore it and continue starting my project to refactor the website.

    Read the article

  • How can I sync files in two different git repositories (not clones) and maintain history?

    - by brian d foy
    I maintain two different git repos that need to share some files, and I'd like the commits in one repo to show up in the other. What's a good way to do that for ongoing maintenance? I've been one of the maintainers of the perlfaq (Github), and recently I fell into the role of maintaining the Perl core documentation, which is also in git. Long before I started maintaining the perlfaq, it lived in a separate source control repository. I recently converted that to git. Periodically, one of the perl5-porters would sync the shared files in the perlfaq repo and the perl repo. Since we've switched to git, we'e been a bit lazy converting the tools, and I'm now the one who does that. For the time being, the two repos are going to stay separate. Currently, to sync the FAQ for a new (monthly) release of perl, I'm almost ashamed to say that I merely copy the perlfaq*.pod files in the perlfaq repo and overlay them in the perl repo. That loses history, etc. Additionally, sometimes someone makes a change to those files in the perl repo and I end up overwriting it (yes, check git diff you idiot!). The files do not have the same paths in the repo, but that's something that I could change, I think. What I'd like to do, in the magical universe of rainbows and ponies, is pull the objects from the perlfaq repo and apply them in the perl repo, and vice-versa, so the history and commit ids correspond in each. Creating patches works, but it's also a lot work to manage it Git submodules seem to only work to pull in the entire external repo I haven't found something like svn's file externals, but that would work in both directions anyway I'd love to just fetch objects from one and cherry-pick them in the other What's a good way to manage this?

    Read the article

  • How can I setup Hudson to use the same repository for different projects and maintain separate chang

    - by Allen
    I typically setup SVN to host 1 big project per repository but a lot of our infrastructure has changed and we now have one main SVN server that has a hierarchy like so Branches Tags Trunk Project1 files & folders Project2 files & folders Project3 files & folders Projects1,2, and 3 do not share anything amongst themselves, they are independent projects each with their own solution file to be built. I can setup projects in Hudson like so Repository Url: http://server/svn/MainRepository Local module directory (optional): /Trunk/Project1 And that will maintain a separate workspace for each project, but every time you commit to Project 2 or Project 3, a build gets kicked off in Hudson for every project based in that repository. Also, any commit made anywhere in the repository is pulled down and inserted into the Hudson changelog for all of them. I know the easiest solution would be to simply separate every project into its own repository. However, if I couldn't do that due to various reasons, is there a feasible way to achieve the functionality that having separate repositories gets me? I want commits to the sub folder of project 1 to only affect project 1. No other project's commits should cause project 1 to build and project 1's changelog in Hudson should only have commit notes from project 1.

    Read the article

  • How to maintain an ordered table with Core Data (or SQL) with insertions/deletions?

    - by Jean-Denis Muys
    This question is in the context of Core Data, but if I am not mistaken, it applies equally well to a more general SQL case. I want to maintain an ordered table using Core Data, with the possibility for the user to: reorder rows insert new lines anywhere delete any existing line What's the best data model to do that? I can see two ways: 1) Model it as an array: I add an int position property to my entity 2) Model it as a linked list: I add two one-to-one relations, next and previous from my entity to itself 1) makes it easy to sort, but painful to insert or delete as you then have to update the position of all objects that come after 2) makes it easy to insert or delete, but very difficult to sort. In fact, I don't think I know how to express a Sort Descriptor (SQL ORDER BY clause) for that case. Now I can imagine a variation on 1): 3) add an int ordering property to the entity, but instead of having it count one-by-one, have it count 100 by 100 (for example). Then inserting is as simple as finding any number between the ordering of the previous and next existing objects. The expensive renumbering only has to occur when the 100 holes have been filled. Making that property a float rather than an int makes it even better: it's almost always possible to find a new float midway between two floats. Am I on the right track with solution 3), or is there something smarter?

    Read the article

  • Asp.net Mvc - Kigg: Maintain User object in HttpContext.Items between requests.

    - by Pickels
    Hallo, first I want to say that I hope this doesn't look like I am lazy but I have some trouble understanding a piece of code from the following project. http://kigg.codeplex.com/ I was going through the source code and I noticed something that would be usefull for my own little project I am making. In their BaseController they have the following code: private static readonly Type CurrentUserKey = typeof(IUser); public IUser CurrentUser { get { if (!string.IsNullOrEmpty(CurrentUserName)) { IUser user = HttpContext.Items[CurrentUserKey] as IUser; if (user == null) { user = AccountRepository.FindByClaim(CurrentUserName); if (user != null) { HttpContext.Items[CurrentUserKey] = user; } } return user; } return null; } } This isn't an exact copy of the code I adjusted it a little to my needs. This part of the code I still understand. They store their IUser in HttpContext.Items. I guess they do it so that they don't have to call the database eachtime they need the User object. The part that I don't understand is how they maintain this object in between requests. If I understand correctly the HttpContext.Items is a per request cache storage. So after some more digging I found the following code. internal static IDictionary<UnityPerWebRequestLifetimeManager, object> GetInstances(HttpContextBase httpContext) { IDictionary<UnityPerWebRequestLifetimeManager, object> instances; if (httpContext.Items.Contains(Key)) { instances = (IDictionary<UnityPerWebRequestLifetimeManager, object>) httpContext.Items[Key]; } else { lock (httpContext.Items) { if (httpContext.Items.Contains(Key)) { instances = (IDictionary<UnityPerWebRequestLifetimeManager, object>) httpContext.Items[Key]; } else { instances = new Dictionary<UnityPerWebRequestLifetimeManager, object>(); httpContext.Items.Add(Key, instances); } } } return instances; } This is the part where some magic happens that I don't understand. I think they use Unity to do some dependency injection on each request? In my project I am using Ninject and I am wondering how I can get the same result. I guess InRequestScope in Ninject is the same as UnityPerWebRequestLifetimeManager? I am also wondering which class/method they are binding to which interface? Since the HttpContext.Items get destroyed each request how do they prevent losing their user object? Anyway it's kinda a long question so I am gradefull for any push in the right direction. Kind regards, Pickels

    Read the article

  • Django: What's an awesome plugin to maintain images in the admin?

    - by meder
    I have an articles entry model and I have an excerpt and description field. If a user wants to post an image then I have a separate ImageField which has the default standard file browser. I've tried using django-filebrowser but I don't like the fact that it requires django-grappelli nor do I necessarily want a flash upload utility - can anyone recommend a tool where I can manage image uploads, and basically replace the file browse provided by django with an imagepicking browser? In the future I'd probably want it to handle image resizing and specify default image sizes for certain article types. Edit: I'm trying out adminfiles now but I'm having issues installing it. I grabbed it and added it to my python path, added it to INSTALLED_APPS, created the databases for it, uploaded an image. I followed the instructions to modify my Model to specify adminfiles_fields and registered but it's not applying in my admin, here's my admin.py for articles: from django.contrib import admin from django import forms from articles.models import Category, Entry from tinymce.widgets import TinyMCE from adminfiles.admin import FilePickerAdmin class EntryForm( forms.ModelForm ): class Media: js = ['/media/tinymce/tiny_mce.js', '/media/tinymce/load.js']#, '/media/admin/filebrowser/js/TinyMCEAdmin.js'] class Meta: model = Entry class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = { 'slug': ['title'] } class EntryAdmin( FilePickerAdmin ): adminfiles_fields = ('excerpt',) prepopulated_fields = { 'slug': ['title'] } form = EntryForm admin.site.register( Category, CategoryAdmin ) admin.site.register( Entry, EntryAdmin ) Here's my Entry model: class Entry( models.Model ): LIVE_STATUS = 1 DRAFT_STATUS = 2 HIDDEN_STATUS = 3 STATUS_CHOICES = ( ( LIVE_STATUS, 'Live' ), ( DRAFT_STATUS, 'Draft' ), ( HIDDEN_STATUS, 'Hidden' ), ) status = models.IntegerField( choices=STATUS_CHOICES, default=LIVE_STATUS ) tags = TagField() categories = models.ManyToManyField( Category ) title = models.CharField( max_length=250 ) excerpt = models.TextField( blank=True ) excerpt_html = models.TextField(editable=False, blank=True) body_html = models.TextField( editable=False, blank=True ) article_image = models.ImageField(blank=True, upload_to='upload') body = models.TextField() enable_comments = models.BooleanField(default=True) pub_date = models.DateTimeField(default=datetime.datetime.now) slug = models.SlugField(unique_for_date='pub_date') author = models.ForeignKey(User) featured = models.BooleanField(default=False) def save( self, force_insert=False, force_update= False): self.body_html = markdown(self.body) if self.excerpt: self.excerpt_html = markdown( self.excerpt ) super( Entry, self ).save( force_insert, force_update ) class Meta: ordering = ['-pub_date'] verbose_name_plural = "Entries" def __unicode__(self): return self.title Edit #2: To clarify I did move the media files to my media path and they are indeed rendering the image area, I can upload fine, the <<<image>>> tag is inserted into my editable MarkItUp w/ Markdown area but it isn't rendering in the MarkItUp preview - perhaps I just need to apply the |upload_tags into that preview. I'll try adding it to my template which posts the article as well.

    Read the article

  • What's your hobby website; do you maintain it for your users or yourself?

    - by Glennular
    What is your hobby website? Do you care if it has high traffic or is it more for personal satisfaction? When deciding on the features to implement are you taking in to consideration the needs of general user-base or features you really want to build? What balance do you use to keep yourself satisfied as well as your users? When do you feel your site is able to release to the world? Do you release it initially and hope for anticipatory beta group? or wait till you have a solid built set of features?

    Read the article

  • Is the Silverstripe CMS as easy to deploy, maintain, and develop on as it appears?

    - by Thomas Owens
    Although I haven't thought about deploying it on my own site, someone I know sent me a link to a CMS called SilverStripe that I've never heard of before. I read their site, looked at and played around with their demo, and so on. It looks like it's a CMS backed by a custom PHP framework that they call Sapphire. And from what I can gather on their website and using their demo, it potentially might be as good and easy as they say (once you get past any learning curve, which appears to be small, considering it looks a lot like other PHP frameworks and CMSes). Has anyone here ever deployed, maintained, or developed a CMS using SilverStripe? If so, could you shed some light on it, from a developer's point-of-view? I also found this earlier question about SilverStripe here on StackOverflow, but I'm more interested from a development point of view than a user or administrator point of view.

    Read the article

  • how to maintain a Presistent state of an app in Android?

    - by androidbase Praveen
    hi all, i am working on my App. in between i pressed the Home button on the device. my app will go to the background tasks. After that i long press the home button it will show my app as a persistent state. i.e where and what i had done in my app. But i click my app in the directory window it restarts my app. i want to do if my app is in the background tasks it will wake up else it will start. how to achieve that? Any Idea?

    Read the article

  • how to maintain a Home Button Presistent state of an app in Android?

    - by androidbase Praveen
    hi all, i am working on my App. in between i pressed the Home button on the device. my app will go to the background tasks. After that i long press the home button it will show my app as a persistent state. i.e where and what i had done in my app. But i click my app in the directory window it restarts my app. i want to do if my app is in the background tasks it will wake up else it will start. how to achieve that? Any Idea?

    Read the article

  • What's the most unsound program you've had to maintain?

    - by Robert Rossney
    I periodically am called upon to do maintenance work on a system that was built by a real rocket surgeon. There's so much wrong with it that it's hard to know where to start. No, wait, I'll start at the beginning: in the early days of the project, the designer was told that the system would need to scale, and he'd read that a source of scalability problems was traffic between the application and database servers, so he made sure to minimize this traffic. How? By putting all of the application logic in SQL Server stored procedures. Seriously. The great bulk of the application functions by the HTML front end formulating XML messages. When the middle tier receives an XML message, it uses the document element's tag name as the name of the stored procedure it should call, and calls the SP, passing it the entire XML message as a parameter. It takes the XML message that the SP returns and returns it directly back to the front end. There is no other logic in the application tier. (There was some code in the middle tier to validate the incoming XML messages against a library of schemas. But I removed it, after ascertaining that 1) only a small handful of messages had corresponding schemas, 2) the messages didn't actually conform to these schemas, and 3) after validating the messages, if any errors were encountered, the method discarded them. "This fuse box is a real time-saver - it comes from the factory with pennies pre-installed!") I've seen software that does the wrong thing before. Lots of it. I've written quite a bit. But I've never seen anything like the steely-eyed determination to do the wrong thing, at every possible turn, that's embodied in the design and programming of this system. Well, at least he went with what he knew, right? Um. Apparently, what he knew was Access. And he didn't really understand Access. Or databases. Here's a common pattern in this code: SELECT @TestCodeID FROM TestCode WHERE TestCode = @TestCode SELECT @CountryID FROM Country WHERE CountryAbbr = @CountryAbbr SELECT Invoice.*, TestCode.*, Country.* FROM Invoice JOIN TestCode ON Invoice.TestCodeID = TestCode.ID JOIN Country ON Invoice.CountryID = Country.ID WHERE Invoice.TestCodeID = @TestCodeID AND Invoice.CountryID = @CountryID Okay, fine. You don't trust the query optimizer either. But how about this? (Originally, I was going to post this in What's the best comment in source code you have ever encountered? but I realized that there was so much more to write about than just this one comment, and things just got out of hand.) At the end of many of the utility stored procedures, you'll see code that looks like the following: -- Fix NULLs SET @TargetValue = ISNULL(@TargetValue, -9999) Yes, that code is doing exactly what you can't allow yourself to believe it's doing lest you be driven mad. If the variable contains a NULL, he's alerting the caller by changing its value to -9999. Here's how this number is commonly used: -- Get target value EXEC ap_GetTargetValue @Param1, @Param2, OUTPUT @TargetValue -- Check target value for NULL value IF @TargetValue = -9999 ... Really. For another dimension of this system, see the article on thedailywtf.com entitled I Think I'll Call Them "Transactions". I'm not making any of this up. I swear. I'm often reminded, when I work on this system, of Wolfgang Pauli's famous response to a student: "That isn't right. It isn't even wrong." This can't really be the very worst program ever. It's definitely the worst one I've worked

    Read the article

  • How to monitor and maintain my grails application in live/production environment?

    - by fabien7474
    It is the first time I have ever launched live a website (with Grails web framework under Amazon EC2 platform and Cloud Foundry) and I realized quickly that I am not ready for monitoring and maintening correctly my application in production mode (fortunately the website is accessible to a very limited number of users) . The issues I have faced so far are: Cannot change my views. I need to redeploy my application I have no monitoring. I don't know who is connected, when do they sign in / sign out... Redploying my application (upload WAR + deploy) takes at least 30 minutes. I don't know how to restart my Tomcat server without a redeploy through Cloud Foundry ! ... So, my question is very simple: What tools (including grails plugins) and methods can you recommend me for taking me out from my current blindness?

    Read the article

  • Ruby File IO question; Maintain file read position between script executions

    - by macek
    I have two files a.txt and b.txt (henceforth a and b). My script iterates through a, does some operation, and potentially inserts a line to b. In the event the script stops, I need it to pick up where it left off. In the example below: foo was copied to b bar was copied to b zim was not copied to b (did not pass some criteria) gaz was copied to b Script stops (for whatever reason) When script starts again, how to open a and start on line "dib"? a.txt foo bar zim gaz // <= last successful copy dib // <= I want to start here on next script execution gir b.txt foo bar gaz // <= note omission of "zim" above gaz

    Read the article

  • How do I maintain coherency between model and view-model in MVVM pattern?

    - by Mike Garrett
    Problem Statement I'm writing a very basic WPF application to alter the contents of a configuration file. The data format is an XML file with a schema. I want to use it as a learning project for MVVM, so I have duly divided the code into Model: C# classes auto-generated from xsd.exe View-Model: View-friendly representation of the Model. View: Xaml and empty code behind I understand how the View-Model can make View-binding a breeze. However, doesn't that leave the View-Model <- Model semantics very awkward? Xsd.exe generates C# classes with arrays for multiple XML elements. However, at the V-VM level you need Observable Collections. Questions: Does this really mean I have to keep two completely different collection types representing the same data in coherence? What are the best practices for maintaining coherence between the Model and the View-Model?

    Read the article

  • How to maintain unique login in windows form application?

    - by Vivek
    Hello All, I am developing a winform application in which user's login is validated through ms sql server 2000 database.When user entry its user name and password, application checks its exists in user table or not. Now my requirement is if a user already login through one system it should not log in through another system. if solution like make entry in database about status of user like on successful log in mark user status is true and on closing application mark false , then in the case of network or hardware failure or system exception. so, please suggest me a optimal solution .

    Read the article

  • How to maintain a persistant network-connection between two applications over a network?

    - by John
    I was recently approached by my management with an interesting problem - where I am pretty sure I am telling my bosses the correct information but I really want to make sure I am telling them the correct stuff. I am being asked to develop some software that has this function: An application at one location is constantly processing real-time data every second and only generates data if the underlying data has changed in any way. On the event that the data has changed send the results to another box over a network Maintains a persistent connection between the both machines, altering the remote box if for some reason the network connection went down From what I understand, I imagine that I need to do some reading on doing some sort of TCP/IP socket-level stuff. That way if the connection is dropped the remote location will be aware that the data it has received may be stale. However management seems to be very convinced that this can be accomplished using SOAP. I was under the impression that SOAP is more or less a way for a client to initiate a procedure from a server and get some results via the HTTP protocol. Am I wrong in assuming this? I haven't been able to find much information on how SOAP might be able to solve a problem like this. I feel like a lot of people around my office are using SOAP as a buzzword and that has generated a bit of confusion over what SOAP actually is - and is capable of. Any thoughts on how to accomplish this task would be appreciated!

    Read the article

  • How to maintain long-lived python projects w.r.t. dependencies and python versions ?

    - by Gyom
    short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architectures (like my old PowerPC mac). Nowadays I'm using a mac (OSX 10.6 on x86-64) and it's a dependency nightmare each time I want to revive script older than a few months. Python itself already comes in three different flavours in /usr/bin (2.5, 2.6, 3.1), but I had to install 2.4 from macports for pygame, something else (cannot remember what) forced me to install all three others from macports as well, so at the end of the day I'm the happy owner of seven (!) instances of python on my system. But that's not the problem, the problem is, none of them has the right (i.e. same set of) libraries installed, some of them are 32bits, some 64bits, and now I'm pretty much lost. For example right now I'm trying to run a three-year-old script (not written by me) which used to use matplotlib/numpy to draw a real-time plot within a rectangle of a wxwidgets window. But I'm failing miserably: py26-wxpython from macports won't install, stock python has wxwidgets included but also has some conflict between 32 bits and 64 bits, and it doesn't have numpy... what a mess ! Obviously, I'm doing things the wrong way. How do you usally cope with all that chaos ?

    Read the article

  • Setting acquired location to a text view: How to maintain?

    - by Mark
    Hi, I have built an app for the Motorola Droid which should automatically update a server with the phone's location. After the user performs a particular task on the main activity screen, an alarm is set to update the user's location periodically, using a service. The alarm is explicitly stopped when the user completes another task. Thing is, I have set up a location manager within the main activity's onCreate() method which is supposed to place the first acquired lat/long into two textview fields. Even though the manifest is set up for acquiring coarse and fine coords and I'm using requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener), with minTime and minDistance set to zero, I'm not seeing the coords coming up on the screen. With that, I'm not recording any locations on the server. When I seed the textviews with sample coords, they are being recorded fine on the server. I am not at a computer that can run the IDE, so don't currently have the code, but am desperate for some help on this. One other thing is that the main activity screen calls a photography app before the user manually clicks "send data". I'm suspicious that I may need to override the main activity's onResume() method to do this location acquisition. Please help, thanks. Mark.

    Read the article

  • Is it possible to maintain the url while redirecting to a classic asp page from a controller?

    - by Matthias
    While migrating a site from a classic asp to MVC, I'm having the problem that not all controllers are implemented yet. For those which are not implemented, I'd like to serve the classic asp page (say /product.asp?id=123) while maintaining the nice url /product/123. To accomplish this I implemented a dummy ProductController which returns a RedirectResult to the classic asp url. But that changes the url in the browsers navigation bar. Requirement has it, that the urls should always be a clean (mvc) one, eventhough the page has not yet been fully migrated. If this can't be done using a dummy controller, what would be an alternative option to solve this problem? Thanks in advance!

    Read the article

  • What is the best way to maintain an entity's original properties when they are not included in MVC binding from edit page?

    - by kingdango
    I have an ASP.NET MVC view for editing a model object. The edit page includes most of the properties of my object but not all of them -- specifically it does not include CreatedOn and CreatedBy fields since those are set upon creation (in my service layer) and shouldn't change in the future. Unless I include these properties as hidden fields they will not be picked up during Binding and are unavailable when I save the modified object in my EF 4 DB Context. In actuality, upon save the original values would be overwritten by nulls (or some type-specific default). I don't want to drop these in as hidden fields because it is a waste of bytes and I don't want those values exposed to potential manipulation. Is there a "first class" way to handle this situation? Is it possible to specify a EF Model property is to be ignored unless explicitly set?

    Read the article

  • How to maintain ComboBox.SelectedItem reference when DataSource is resorted?

    - by Dave
    This really seems like a bug to me, but perhaps some databinding gurus can enlighten me? (My WinForms databinding knowledge is quite limited.) I have a ComboBox bound to a sorted DataView. When the properties of the items in the DataView change such that items are resorted, the SelectedItem in my ComboBox does not keep in-sync. It seems to point to someplace completely random. Is this a bug, or am I missing something in my databinding? Here is a sample application that reproduces the problem. All you need is a Button and a ComboBox: public partial class Form1 : Form { private DataTable myData; public Form1() { this.InitializeComponent(); this.myData = new DataTable(); this.myData.Columns.Add("ID", typeof(int)); this.myData.Columns.Add("Name", typeof(string)); this.myData.Columns.Add("LastModified", typeof(DateTime)); this.myData.Rows.Add(1, "first", DateTime.Now.AddMinutes(-2)); this.myData.Rows.Add(2, "second", DateTime.Now.AddMinutes(-1)); this.myData.Rows.Add(3, "third", DateTime.Now); this.myData.DefaultView.Sort = "LastModified DESC"; this.comboBox1.DataSource = this.myData.DefaultView; this.comboBox1.ValueMember = "ID"; this.comboBox1.DisplayMember = "Name"; } private void saveStuffButton_Click(object sender, EventArgs e) { DataRowView preUpdateSelectedItem = (DataRowView)this.comboBox1.SelectedItem; // OUTPUT: SelectedIndex = 0; SelectedItem.Name = third Debug.WriteLine(string.Format("SelectedIndex = {0:N0}; SelectedItem.Name = {1}", this.comboBox1.SelectedIndex, preUpdateSelectedItem["Name"])); this.myData.Rows[0]["LastModified"] = DateTime.Now; DataRowView postUpdateSelectedItem = (DataRowView)this.comboBox1.SelectedItem; // OUTPUT: SelectedIndex = 2; SelectedItem.Name = second Debug.WriteLine(string.Format("SelectedIndex = {0:N0}; SelectedItem.Name = {1}", this.comboBox1.SelectedIndex, postUpdateSelectedItem["Name"])); // FAIL! Debug.Assert(object.ReferenceEquals(preUpdateSelectedItem, postUpdateSelectedItem)); } }

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >