Search Results

Search found 871 results on 35 pages for 'simon hume'.

Page 26/35 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • ASP.NET MVC 2: Linq to SQL entity w/ ForeignKey relationship and Default ModelBinder strangeness

    - by Simon
    Once again I'm having trouble with Linq to Sql and the MVC Model Binder. I have Linq to Sql generated classes, to illustrate them they look similar to this: public class Client { public int ClientID { get; set; } public string Name { get; set; } } public class Site { public int SiteID { get; set; } public string Name { get; set; } } public class User { public int UserID { get; set; } public string Name { get; set; } public int? ClientID { get; set; } public EntityRef<Client> Client { get; set; } public int? SiteID { get; set; } public EntityRef<Site> Site { get; set; } } The 'User' has a relationship with the 'Client' and 'Site . The User class has nullable ClientIDs and SiteIDs because the admin users are not bound to a Client or Site. Now I have a view where a user can edit a 'User' object, the view has fields for all the 'User' properties. When the form is submitted, the appropiate 'Save' action is called in my UserController: public ActionResult Save(User user, FormCollection form) { //form['SiteID'] == 1 //user.SiteID == 1 //form['ClientID'] == 1 //user.ClientID == null } The problem here is that the ClientID is never set, it is always null, even though the value is in the FormCollection. To figure out whats going wrong I set breakpoints for the ClientID and SiteID getters and setters in the Linq to Sql designer generated classes. I noticed the following: SiteID is being set, then ClientID is being set, but then the Client EntityRef property is being set with a null value which in turn is setting the ClientID to null too! I don't know why and what is trying to set the Client property, because the Site property setter is never beeing called, only the Client setter is being called. Manually setting the ClientID from the FormCollection like this: user.ClientID = int.Parse(form["ClientID"].ToString()); throws a 'ForeignKeyReferenceAlreadyHasValueException', because it was already set to null before. The only workaround I have found is to extend the generated partial User class with a custom method: Client = default(EntityRef<Client>) but this is not a satisfying solution. I don't think it should work like this? Please enlighten me someone. So far Linq to Sql is driving me crazy! Best regards

    Read the article

  • zip -j command, what does the -j option mean?

    - by Simon Guo
    Wondering what is the -j option mean in the zip command. I found the explanation as following: -j Store just the name of a saved file (junk the path), and do not store directory names. By default, zip will store the full path (relative to the current path). But not quite sure what it is exact mean? Can anyone explain it using the following command as an example? C:\programs\zip -j myzipfile file1 file2 file3 Thank you.

    Read the article

  • How to detect unresolved symbol when creating a library ?

    - by Simon
    Hello everyone, Under Solaris 10, I'm creating a library A.so that calls a function f() which is defined in library B.so. To compile the library A.so, I declare in my code f() as extern. Unfortunately, I "forgot" to declare in A's makefile that it has to link with B. However, "make A" causes no warning, no error, and the library A.so is created. Of course, when executing A's code, the call of f() crashes because it is undefined. Is there a way (linker option, code trick...) to make the compilation of library A fail ? How can I be sure that all symbols refered to in library A are defined at compile time ? Thanks for any suggestions.

    Read the article

  • How to get the Queue name that NServiceBus pulled the message from.

    - by Simon
    I can use this code to get the return address. string returnAddress = Bus.CurrentMessageContext.ReturnAddress; But how do i get the "to address" of the message. i.e. the Queue that NServiceBus pulled the message from. I had a look through the source and it seems Bus.Transport.Address is what i want but there is no get on Transport Note: I am within the "Handle" method of a message handler.

    Read the article

  • Using Cases to change background colour | Visual Studio 2008

    - by Simon
    I really need help working with cases, I'm only learning it so far, but just can't get a drop down menu to work that would change the background of a Textbox. Private Sub cbColours_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbColours.SelectedIndexChanged Select Case colours Case Is = "Red" txtSpace.BackColor = Color.Red Case Is = "Blue" txtSpace.BackColor = Color.Blue Case Is = "Green" txtSpace.BackColor = Color.Green End Select End Sub It isn't doing anything at all... In the dropdown menu, it has Red, Blue and Green one per line When the value (e.g. Green) is clicked, it will then change the Textbox to the colour selected. Many help appreciated :)

    Read the article

  • Newbie question on MvcContrib TestHelpers

    - by Simon Lomax
    Hi, I'm just starting to use the TestHelpers in MvcContrib. I want to try and test an action method on my controller that itself tests if IsAjaxRequest() is true. I've used the same code that is shown in the TestHelper samples to set up the TestControllerBuilder _controller = new StarsController(); _builder = new TestControllerBuilder(); _builder.InitializeController(_controller); So that _controller has all the faked/mocked HttpContext inside it, which is really great. But what do I do now to force IsAjaxRequest() on the internally faked Request object to return true?

    Read the article

  • PHP and Apache environment variables

    - by Simon
    Hello, I want to pass an environment variable in linux to apache on start up. export MYVAR=5 --I define my environment variable on the command line PassEnv MYVAR --set apache to import the variable in apache config file apachectl restart --when I restart apache I don't get an error message. However I have noticed that if I do not create the environment variable in my first step, I get a warning message, so must be working here echo $_SERVER['MYVAR'] --i try to access the environment variable within PHP but it is not defined I've observed that if I try to PassEnv an environment variable that already exits (one that I havn't created myself) it works fine. The SetEnv directive also works fine. I'd really like to pass an environment variable to apache on the fly without writing it in a file. Help much appreciated. I'm using CentOS, PHP5 and Apache2. Thanks.

    Read the article

  • C++ memcpy problem :(

    - by Simon
    Hey all :) I have a problem my src pointer of memcpy is pointing wrong. unsigned char* lpBuffer is a buffer that contains my bytes, i checked with olly. The code: IMAGE_DOS_HEADER iDOSh; memcpy(&iDOSh,lpBuffer,sizeof(iDOSh)); The problem is that lpBuffer points wrong, output from debugger is dest = 002859E8 RIGHT src = 000001D8 FALSE src is pointing invalid :( i have no idea why Thanks for reading

    Read the article

  • Can't export release build / compile for Adobe Air 1.0

    - by Shawn Simon
    I opened up an old project in Flex Builder 3 which runs on Adobe AIR 1.0. I believe it was originally written in Flex Builder 2. When I try to run the air app, nothing happens. When I try to export a release build, I get this error: If I change the main-app.xml file to use the 1.5 version of the namespace, it builds fine. Unfortunately, the clients environment runs on 1.0. Ideas?

    Read the article

  • Comparing date in access database

    - by Simon
    How can i compare the day in the access database to a given day in c#? The date column in the database is an general date(day/month/year) try { database = new OleDbConnection(connectionString); database.Open(); date = DateTime.Now.ToShortDateString(); string queryString = "SELECT user_name,zivila.naziv " + "FROM (users LEFT JOIN obroki_save ON obroki_save.ID_uporabnika=users.ID)" + " LEFT JOIN zivila ON zivila.ID=obroki_save.ID_zivila " + " WHERE users.ID= " + a.ToString() + " AND obroki_save.datum=# " + date; loadDataGrid(queryString); } catch (Exception ex) { MessageBox.Show(ex.Message); return; }

    Read the article

  • Date range/query problem..

    - by Simon
    Am hoping someone can help me out a bit with date ranges... I have a table with 3 fields id, datestart, dateend I need to query this to find out if a pair of dates from a form are conflicting i.e table entry 1, 2010-12-01, 2010-12-09 from the form 2010-12-08, 20-12-15 select id from date_table where '2010-12-02' between datestart and dateend; That returns me the id that I want, but what I would like to do is to take the date range from the form and do a query similar to what I have got that will take both form dates 2010-12-08, 20-12-15 and query the db to ensure that there is no conflicting date ranges in the table. Am sat scratching my head with the problem... TIA

    Read the article

  • Why does Android allocate more memory than needed when loading images

    - by Simon
    Folks, I don't think that this is a duplicate and is NOT one of those how do I avoid OOMs questions. This is a genuine quest for knowledge so hold off on those down votes please... Imagine I have a JPEG of 500x500 pixels. I load it as ARGB_8888 which is as "bad as it gets". I would expect Android to allocate 500x500x4 bytes = a little under 1MB however, look at a heap dump and you will see that Android allocates significantly more, often factors of 5-10 times greater. You frequently see questions on here about OOMS where the stack trace shows a heap request of say 15MB and it is ALWAYS much larger than is required simply to hold the bytes of the image. The OP usually catches some downvotes then is bombarded with stock answers and comments about using less memory (thanks Romain!) and in scaling. I think there is more than meets the eye here. Anybody know why this is? If there is no apparent answer, I will put together an SSCCE if it helps. PS. I assume that JPEG vs PNG etc is irrelevant since we're talking about the memory usage of the backing bitmap which is simply x times y times BPP - or am I being slow?

    Read the article

  • How to enable/create elements on the fly

    - by Simon S
    Hi all I am using a combination of PHP, jQuery and Spry to serve a series of listboxes in which a user will select first the type of vehicle, then the make, then the model and finally the specific model. All my listboxes (SELECT) are working fine, and they update properly using the Spry elements. Each listbox is populated from a different Spry XML Dataset, and this is my problem. If I present all four listboxes to the user, the script has to go and fetch all four lots of XML to populate all four listboxes, taking several seconds. What I want to do is to create/enable the listboxes in order, so at the user selects from the first listbox, the second is created/enabled, when they select from the second, the third is created/enabled... and so on. Setting the disabled attribute is no good because the script has already fetched the XML before this is processed. Any ideas?? Si

    Read the article

  • Javascript error : " 'Sys' is undefined "

    - by Simon
    Hi there, I keep having an error when running my web application. The error does not cause a compilation error when on live server at least a javascript error and nothing else. But the real problem is when "debug" ... javascript error stops the compilation and I have to "Continue" three times before proceeding normally my debug. But this error occurs at every refresh the page. All this using Visual Studio. After several hours of search on google, I saw that it was a problem with the ScriptManager and Ajax. The real problem is that I do not use any Ajax on this page but the ScriptManager is on the masterpage. Worse still, on any other page on the website, that may use Ajax or not, no javascript error! Only THIS page cause this error! Any suggestion? Note that I usualy talk french so there's probably error and sorry for this! EDIT There's the 3 places were compilation stop. 1. Sys.WebForms.PageRequestManager._initialize('ctl00$ctl08', document.getElementById('aspnetForm')); 2. Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90); 3. Sys.Application.initialize();

    Read the article

  • Write permission for a specific folder in web.config

    - by Simon Dugré
    My question is preaty simple. Is there any way to give current user (IIS User, in this case, ASP NET USER) permission to write to a specific folder location (folder inside our web application) using web.config? Because, it's getting boring to ask to the web hoster to gain access to a specific folder each time we want to do a file uploader on a website. I know it's maybe preaty simple to find an answer using google, but it keeps returning me how to write INTO web.config instead of permission to write into web.config FOR a specific folder. In addition, I'm french so my english is not at the top.

    Read the article

  • Naming conventions for complex getters in Java

    - by Simon
    Hi there! I was reading this C# article about the usage of properties and methods. It points out why and when to use properties or methods. Properties are meant to be used like fields, meaning that properties should not be computationally complex or produce side effects I was asking myself how you could express this difference in Java, where you only use getters for the retrieval of data. What is your opinion?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >