Search Results

Search found 18854 results on 755 pages for 'mr null'.

Page 19/755 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • redirectToAction results in null model

    - by Maslow
    I have 2 actions on a controller: public class CalculatorsController : Controller { // // GET: /Calculators/ public ActionResult Index() { return RedirectToAction("Accounting"); } public ActionResult Accounting() { var combatants = Models.Persistence.InMemoryCombatantPersistence.GetCombatants(); Debug.Assert(combatants != null); var bvm = new BalanceViewModel(combatants); Debug.Assert(bvm!=null); Debug.Assert(bvm.Combatants != null); return View(bvm); } } When the Index method is called, I get a null model coming out. When the Accounting method is called directly via it's url, I get a hydrated model.

    Read the article

  • select rows with column that is not null?

    - by fayer
    by default i have one column in mysql table to be NULL. i want to select some rows but only if the field value in that column is not NULL. what is the correct way of typing it? $query = "SELECT * FROM names WHERE id = '$id' AND name != NULL"; is this correct?

    Read the article

  • not including null values in sql join

    - by Ashanti
    Hi, I have two tables CustomerAddress(CustomerId, City, Country) and CustomerTransactions(TransactionId, CustomerId, CustomerContact). Here are the values in the tables: For CustomerAddress: 1001, El Paso, USA 1002, Paris, France 1003, Essen, Germany For CustomerTransactions: 98, 1001, Phillip 99, 1001, NULL 100, 1001, NULL 101, 1003, Carmen 102, 1003, Carmen 103, 1003, Lola 104, 1003, NULL 105, 1002, NULL I'm trying to join both tables and have the following result set: 1001, El Paso, USA, Phillip 1002, Paris, France, (empty string) 1003, Essen, Germany, Carmen 1003, Essen, Germany, Lola It seems like a simple join but I'm having trouble coming up with the above result set. Please help. Thanks.

    Read the article

  • Why does GetClusterShape return null when the cluster specification was retrieved through the GetClu

    - by Markus Olsson
    Suppose I have a virtual earth shape layer called shapeLayer1 (my creative energy is apparently at an alltime low). When i call the GetClusteredShapes method I get an array of VEClusterSpecification objects that represent each and every one of my currently visible clusters; no problem there. But when I call the GetClusterShape() method it returns null... null! Why on earth would it do that? I used firebug to confirm that the private variable of the VEClusterSpecification that's supposed to hold a reference to the shape is indeed null so it's not the method that's causing the problem. Some have suggested that this is actually documented behavior Returns null if a VEClusterSpecification object was returned from the VEShapeLayer.GetClusteredShapes Method But looking at the current MSDN documentation for the VEShape class it says: Returns if a VEClusterSpecification object was returned from the VEShapeLayer.GetClusteredShapes Method Is this a bug or a feature? Is there any known workarounds or (if it is a bug) some plan on when they are going to fix it?

    Read the article

  • NULL-keys for key/value table

    - by user72185
    (Using Oracle) I have a table with key/value pairs like this: create table MESSAGE_INDEX ( KEY VARCHAR2(256) not null, VALUE VARCHAR2(4000) not null, MESSAGE_ID NUMBER not null ) I now want to find all the messages where key = 'someKey' and value is 'val1', 'val2' or 'val3' - OR value is null in which case there will be no entry in the table at all. This is to save space; there would be a large number of keys with null values if I stored them all. I think this works: SELECT message_id FROM message_index idx WHERE ((key = 'someKey' AND value IN ('val1', 'val2', 'val3')) OR NOT EXISTS (SELECT 1 FROM message_index WHERE key = 'someKey' AND idx.message_id = message_id)) But is is extremely slow. Takes 8 seconds with 700K records in message_index and there will be many more records and more search criteria when moving outside of my test environment. Primary key is key, value, message_id: add constraint PK_KEY_VALUE primary key (KEY, VALUE, MESSAGE_ID) And I added another index for message_id, to speed up searching for missing keys: create index IDX_MESSAGE_ID on MESSAGE_INDEX (MESSAGE_ID) I will be doing several of these key/value lookups in every search, not just one as shown above. So far I am doing them nested, where output id's of one level is the input to the next. E.g.: SELECT message_id from message_index WHERE (key/value compare) AND message_id IN ( SELECT ... and so on ) What can I do to speed this up?

    Read the article

  • JQuery and WCF - GET Method passes null

    - by user70192
    Hello, I have a WCF service that accepts requests from JQuery. Currently, I can access this service. However, the parameter value is always null. Here is my WCF Service definition: [OperationContract] [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] public string ExecuteQuery(string query) { // NOTE: I get here, but the query parameter is always null string results = Engine.ExecuteQuery(query); return results; } Here is my JQuery call: var searchUrl = "/services/myService.svc/ExecuteQuery"; var json = { "query": eval("\"test query\"") }; alert(json2string(json)); // Everything is correct here if (json != null) { $.ajax({ type: "GET", url: searchUrl, contentType: "application/json; charset=utf-8", data: json2string(json), dataType: "json" }); } What am I doing wrong? It seems odd that I can call the service but the parameter is always null. Thank you

    Read the article

  • What's the difference between an option type and a nullable type?

    - by Peter Olson
    In F# mantra there seems to be a visceral avoidance of null, Nullable<T> and its ilk. In exchange, we are supposed to instead use option types. To be honest, I don't really see the difference. My understanding of the F# option type is that it allows you to specify a type which can contain any of its normal values, or None. For example, an Option<int> allows all of the values that an int can have, in addition to None. My understanding of the C# nullable types is that it allows you to specify a type which can contain any of its normal values, or null. For example, a Nullable<int> a.k.a int? allows all of the values that an int can have, in addition to null. What's the difference? Do some vocabulary replacement with Nullable and Option, null and None, and you basically have the same thing. What's all the fuss over null about?

    Read the article

  • Is passing NULL param exactly the same as passing no param

    - by park
    I'm working with a function whose signature looks like this afunc(string $p1, mixed $p2, array $p3 [, int $p4 = SOM_CONST [, string $p5 ]] ) In some cases I don't have data for the last parameter $p5 to pass, but for the sake of consistency I still want to pass something like NULL. So my question, does PHP treat passing a NULL exactly the same as not passing anything? somefunc($p1, $p2, $p3, $p4 = SOM_CONST); somefunc($p1, $p2, $p3, $p4 = SOM_CONST, NULL);

    Read the article

  • How can I set a field to null in a Pre-Update Plugin

    - by Juergen
    I developed a Pre-Update Plugin for the Case entity. In this plugin I want to set a string field to a new value. It works smoothly if the new value is not null. But if the new value si null, it is just ignored. This works: Incident caseTarget = ((Entity) localContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<Incident>(); caseTarget.ProductSerialNumber = "new value"; After the execution of the plugin, the ProductSerialNumber field has value "new value". This doesn't work: Incident caseTarget = ((Entity) localContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<Incident>(); caseTarget.ProductSerialNumber = null; After the execution of the plugin, the ProductSerialNumber field has still its old value. How can I set the target's field to null?

    Read the article

  • MonoRail - How to grab records where a column isn't null

    - by Justin
    Hey, In MonoRail/Active Record if I want to grab all records that have a certain column equal to null, I can do: public static Category[] AllParentCategories() { return (FindAllByProperty("Parent.Id", null)); } However, what if I want to grab all records where that column doesn't equal null? I can't figure out how to do that using this FindAllByProperty method, is there another method that is more flexible or a way to grab records using a linq-like querying language? Thanks, Justin

    Read the article

  • Constructor invocation returned null: what to do?

    - by strager
    I have code which looks like: private static DirectiveNode CreateInstance(Type nodeType, DirectiveInfo info) { var ctor = nodeType.GetConstructor(new[] { typeof(DirectiveInfo) }); if(ctor == null) { throw new MissingMethodException(nodeType.FullName, "ctor"); } var node = ctor.Invoke(new[] { info }) as DirectiveNode; if(node == null) { // ???; } return node; } I am looking for what to do (e.g. what type of exception to throw) when the Invoke method returns something which isn't a DirectiveNode or when it returns null (indicated by // ??? above). (By the method's contract, nodeType will always describe a subclass of DirectiveNode.) I am not sure when calling a constructor would return null, so I am not sure if I should handle anything at all, but I still want to be on the safe side and throw an exception if something goes wrong.

    Read the article

  • about null values!

    - by user329820
    Hi I have a question that if we declare a variable and then do not set it explicitly to null value then it would be null outomatically ,i mean that the below code will return true or false ? thanks DECLARE @val CHAR(4) If @val = NULL

    Read the article

  • Convert Null Value to String - C#.NET

    - by peace
    foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { PropertyItem.SetValue(this, objDataTable.Rows[0][PropertyItem.Name.ToString()], null); } In one of the loops i get this exceptional error: Object of type 'System.DBNull' cannot be converted to type 'System.String'. The error occurs because one of the fields in the database has no value (null), so the string property could not handle it. How can i convert this null to string? I got this solution If you know a shorter or better one, feel free to post it. I'm trying to avoid checking on every loop is current value is null or not.

    Read the article

  • LINQ, Left Join, Only Get where null in join table

    - by kmehta
    Hi. I am trying to do a left outer join on two tables, but I only want to return the results from the first table where the second table does not have a record (null). var agencies = from a in agencyList join aa in joinTable on a.AgencyId equals aa.AgencyId into joined from aa in joined.DefaultIfEmpty() where aa == null) select a; But this does not exclude the non null values of aa, and returns all the records just the same as if the 'where aa == null' was not there. Any help is appreciated. Thanks.

    Read the article

  • Constructor invokation returned null: what to do?

    - by strager
    I have code which looks like: private static DirectiveNode CreateInstance(Type nodeType, DirectiveInfo info) { var ctor = nodeType.GetConstructor(new[] { typeof(DirectiveInfo) }); if(ctor == null) { throw new MissingMethodException(nodeType.FullName, "ctor"); } var node = ctor.Invoke(new[] { info }) as DirectiveNode; if(node == null) { // ???; } return node; } I am looking for what to do (e.g. what type of exception to throw) when the Invoke method returns something which isn't a DirectiveNode or when it returns null (indicated by // ??? above). (By the method's contract, nodeType will always describe a subclass of DirectiveNode.) I am not sure when calling a constructor would return null, so I am not sure if I should handle anything at all, but I still want to be on the safe side and throw an exception if something goes wrong.

    Read the article

  • Bizarre WHERE col = NULL behavior

    - by Kenneth
    This is a problem one of our developers brought to me. He stumbled across an old stored procedure which used 'WHERE col = NULL' several times. When the stored procedure is executed it returns data. If the query inside the stored procedure is executed manually it will not return data unless the 'WHERE col = NULL' references are changed to 'WHERE col IS NULL'. Can anyone explain this behavior?

    Read the article

  • java api design - NULL or Exception

    - by srini.venigalla
    Is it better to return a null value or throw an exception from an API method? Returning a null requires ugly null checks all over, and cause a major quality problem if the return is not checked. Throwing an exception forces the user to code for the faulty condition, but since Java exceptions bubble up and force the caller code to handle them, in general, using custom exceptions may be a bad idea (specifically in java). Any sound and practical advice?

    Read the article

  • Removing "Using temporary; Using filesort" from this MySQL select+join+group by query

    - by claytontstanley
    I have the following query: select t.Chunk as LeftChunk, t.ChunkHash as LeftChunkHash, q.Chunk as RightChunk, q.ChunkHash as RightChunkHash, count(t.ChunkHash) as ChunkCount from chunksubset as t join chunksubset as q on t.ID = q.ID group by LeftChunkHash, RightChunkHash And the following explain table: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE subsets ref PRIMARY,IDIndex,SubsetIndex SubsetIndex 767 const 522014 "Using where; Using temporary; Using filesort" 1 SIMPLE subsets eq_ref PRIMARY,IDIndex,SubsetIndex PRIMARY 771 sotero.subsets.Id,const 1 "Using where; Using index" 1 SIMPLE c ref IDIndex IDIndex 4 sotero.subsets.Id 12 "Using where" 1 SIMPLE c ref IDIndex IDIndex 4 sotero.subsets.Id 12 note the "using temporary; using filesort". When this query is run, I quickly run out of RAM (presumably b/c of the temp table), and then the HDD kicks in, and the query slows to a halt. I thought it might be an index issue, so I started adding a few that sort of made sense: Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment chunks 0 PRIMARY 1 ChunkId A 17796190 NULL NULL BTREE chunks 1 ChunkHashIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 IDIndex 1 Id A 1483015 NULL NULL BTREE chunks 1 ChunkIndex 1 Chunk A 243783 NULL NULL BTREE chunks 1 ChunkTypeIndex 1 ChunkType A 2 NULL NULL BTREE chunks 1 chunkHashByChunkIDIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByChunkIDIndex 2 ChunkId A 17796190 NULL NULL BTREE chunks 1 chunkHashByChunkTypeIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByChunkTypeIndex 2 ChunkType A 261708 NULL NULL BTREE chunks 1 chunkHashByIDIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByIDIndex 2 Id A 17796190 NULL NULL BTREE But still using the temporary table. The db engine is MyISAM. How can I get rid of the using temporary; using filesort in this query? Just changing to InnoDB w/o explaining the underlying cause is not a particularly satisfying answer. Besides, if the solution is to just add the proper index, then that's much easier than migrating to another db engine.

    Read the article

  • SQL for sorting boolean column as true, null, false

    - by petehern
    My table has three boolean fields: f1, f2, f3. If I do SELECT * FROM table ORDER BY f1, f2, f3 the records will be sorted by these fields in the order false, true, null. I wish to order them with null in between true and false: the correct order should be true, null, false. I am using PostgreSQL.

    Read the article

  • xUnit false positive when comparing null terminated strings

    - by mr.b
    I've come across odd behavior when comparing strings. First assert passes, but I don't think it should.. Second assert fails, as expected... [Fact] public void StringTest() { string testString_1 = "My name is Erl. I am a program\0"; string testString_2 = "My name is Erl. I am a program"; Assert.Equal<string>(testString_1, testString_2); Assert.True(testString_1.Equals(testString_2)); } Any ideas?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >