Search Results

Search found 5279 results on 212 pages for 'optional arguments'.

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

  • LINQ to SQL Where Clause Optional Criteria

    - by RSolberg
    I am working with a LINQ to SQL query and have run into an issue where I have 4 optional fields to filter the data result on. By optional, I mean has the choice to enter a value or not. Specifically, a few text boxes that could have a value or have an empty string and a few drop down lists that could have had a value selected or maybe not... For example: using (TagsModelDataContext db = new TagsModelDataContext()) { var query = from tags in db.TagsHeaders where tags.CST.Equals(this.SelectedCust.CustCode.ToUpper()) && Utility.GetDate(DateTime.Parse(this.txtOrderDateFrom.Text)) <= tags.ORDDTE && Utility.GetDate(DateTime.Parse(this.txtOrderDateTo.Text)) >= tags.ORDDTE select tags; this.Results = query.ToADOTable(rec => new object[] { query }); } Now I need to add the following fields/filters, but only if they are supplied by the user. Product Number - Comes from another table that can be joined to TagsHeaders. PO Number - a field within the TagsHeaders table. Order Number - Similar to PO #, just different column. Product Status - If the user selected this from a drop down, need to apply selected value here. The query I already have is working great, but to complete the function, need to be able to add these 4 other items in the where clause, just don't know how!

    Read the article

  • ctypes DLL with optional dependencies

    - by pisswillis
    Disclaimer: I'm new to windows programming so some of my assumptions may be wrong. Please correct me if so. I am developing a python wrapper for a C API using ctypes. The API ships with both 64 and 32 DLLs/LIBs. I can succesfully load the DLL using ctypes.WinDLL('TheLibName') and call functions etc etc. However some functions were not doing what they should. Upon further investigation it appears that the 32bit DLL is being used, which is what is causing the unexpected behaviour. I have tried using ctypes.WinDLL('TheLibName64') but the module is not found. I have tried registering the DLL with regsrv32, but it reports there is no entry point (it also reports no entry point when I try and register TheLibName, which is found by WinDLL(). The DLL came with a sample project in Visual Studio (I have 0 experience with VS so again please correct me here) which builds both 32 and 64 bit versions of the sample project. In the .vcsproj file the configurations for the 64 bit version include: AdditionalDependencies="TheLibName64.lib" in the VCLinkerTool section. In windows/system32 there are both TheLibName.dll/.lib, and TheLibName64.dll/.lib. So it seems to me that my problem is now to make the python ctypes DLL loader load these optional dependencies when the DLL is loaded. However I can't find any information on this (perhaps because, as a doze noob, I do not know the correct terminology) in the ctypes documentation. Is there a way to do this in ctypes? Am I going about this in completely the wrong way? Any help or general information about optional DLL dependencies and how they are loaded in windows would be much appreciated. Thanks

    Read the article

  • Optional parameters with named query in Hibernate?

    - by Ickster
    Is there any way to specify optional parameters (such as when search parameters are provided from a form and not all parameters are required) in a named query when using Hibernate? I'm using a native SQL query, but the question is probably applicable to named HQL queries as well. I'm pretty sure the answer to this is 'no', but I haven't find the definitive answer in the documentation yet.

    Read the article

  • Optional parameters with PHP SoapClient class on wsdl mode

    - by Maraino
    With the SoapClient class on PHP5.x and working against a SOAP web service that has optional parameters in its methods, you won't have any problem if you use the non-wsdl mode. But, at least by default, with the wsdl mode, if you don't fill all the parameters you will get an error like: SOAP-ERROR: Encoding: object hasn't 'xxx' property Is there any way to avoid that error without working with the non-wsdl mode and without filling all the parameters?

    Read the article

  • Ruby: Passing optional objects to method

    - by Sam
    Class TShirt def size(suggested_size) if suggested_size == nil size = "please choose a size" else size = suggested end end end tshirt = TShirt.new tshirt.size("M") == "M" tshirt = TShirt.new size = tshirt.size(nil) == "please choose a size" What is a better way to have optional objects in a method? Procs?

    Read the article

  • Rails Multiple Models per Form, Optional FK Association

    - by ckarbass
    Given the following pseudo-code: Company has_many :jobs Job belongs_to :company I'm creating a form to post a new job. In the form, I want to have two fields for an optional company. On submission, if a company was entered, I want to either create or update the company and associate it with the new job. I know if the company exists by searching the companies table for the company's url. Is it possible to do this using form_for, fields_for, and accepts_nested_attributes_for given the company may not exist?

    Read the article

  • Optional group with PSToogleSwitch

    - by maxbareis
    Hi, I'd like to have a settings bundle behavior similar to the iPhone WiFi settings. If you select the toggle switch and set it to on, an optional group with the specific settings appears. How is this done? I haven't found any clue by now.

    Read the article

  • Setting the default value of a C# Optional Parameter

    - by Jaxidian
    Whenever I attempt to set the default value of an optional parameter to something in a resource file, I get a compile-time error of Default parameter value for 'message' must be a compile-time constant. Is there any way that I can change how the resource files work to make this possible? public void ValidationError(string fieldName, string message = ValidationMessages.ContactNotFound) In this, ValidationMessages is a resource file.

    Read the article

  • How do i resize image file to optional sizes

    - by shuxer
    Hi I have image upload form, user attaches aimage file, and selects image size to resize the uploaded image file(200kb, 500kb, 1mb, 5mb, Original). Then my script needs to resize image file size based on user's optional size, but im not sure how to implement this feature, For example, user uploads image with one 1mb size, and if user selects 200KB to resize, then my script should save it with 200kb size. Does anyone know or have an experience on similar task ? Thanks for you reply in advance.

    Read the article

  • How can you use optional parameters in C#?

    - by kurious
    We're building a web API that's programmatically generated from a C# class (the class has method "GetFooBar(int a, int b)" and the API has a method GetFooBar taking query params like &a=foo&b=bar. The classes needs to support optional parameters, which isn't supported in C# the language. What's the best approach?

    Read the article

  • why is optional chaining required in an if let statement

    - by b-ryan ca
    Why would the Swift compiler expect me to write if let addressNumber = paul.residence?.address?.buildingNumber?.toInt() { } instead of just writing: if let addressNumber = paul.residence.address.buildingNumber.toInt() { } The compiler clearly has the static type information to handle the conditional statement for the first dereference of the optional value and each following value. Why would it not continue to do so for the following statements?

    Read the article

  • ANTLR C grammar, optional init_declarator_list?

    - by eisbaw
    Hello, In the ANSI C grammar for ANTLR v3 ( http://antlr.org/grammar/1153358328744/C.g ), how can init_declarator_list be optional in rule declaration ? Instead of: | declaration_specifiers init_declarator_list? ';' -I would say: | declaration_specifiers init_declarator_list ';' What part of the C standard allows statements like: int; EDIT: I just tried, it is allowed! Okay then, why is it allowed?

    Read the article

  • Specifying Entire Path As Optional Rails 3.0.0

    - by Kevin Sylvestre
    I want to create a Rails 3 route with entirely optional parameters. The example route is: match '(/name/:name)(/height/:height)(/weight/:weight)' => 'people#index' The route works if I specify it as: match '/people(/name/:name)(/height/:height)(/weight/:weight)' => 'people#index' But I want to have this as the root URL. Thanks.

    Read the article

  • ObjC: required to optional

    - by Joschy
    Hello Guys! Situation: A protocol A implements a protocol B. B has some @optional and some (@)required methods. Question: Is it possible in protocol A to set a method from B to the opposite (opt. to reeq. and vv.)? Cheers!

    Read the article

  • Variable Assignment for arguments with a for loop

    - by RainbowDashDC
    Alright, so, I've searched quite a bit on how to do this but I've given up as I simply couldn't find anything. So, I have a code (below); it's main purpose is to get 9 arguments and assign them as a variable-- ignore the echo's and pipping. My question is: How can I simplfy this with a for loop or such so it doesn't take as much code, and if possible, have more than 9 arguments aswell set pkg1=%1 set pkg2=%2 set pkg3=%3 set pkg4=%4 set pkg5=%5 set pkg6=%6 set pkg7=%7 set pkg8=%8 set pkg9=%9 IF DEFINED pkg1 (echo %1.ini 1> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg2 (echo %2.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg3 (echo %3.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg4 (echo %4.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg5 (echo %5.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg6 (echo %6.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg7 (echo %7.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg8 (echo %8.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg9 (echo %9.ini 1>> %WINGET_TEMP%\args.rdc 2>nul)

    Read the article

  • Starting CLI application programmatically does not work depending on arguments

    - by Daniel Beck
    I try to start plink.exe (PuTTY Link, the command line utility/version of PuTTY) from a C# application to establish an SSH reverse tunnel, but it does no longer work as soon as I pass the correct parameters. What does that mean? The following works as expected: it opens a command line window, displays that I forgot to pass the password for the -pw argument quits, and shows the prompt. I know it got the arguments, since it specifically requests the one thing I did not provide. Uri uri = omitted; ProcessStartInfo info = new ProcessStartInfo(); info.FileName = "cmd"; info.Arguments = "/k \"C:\\Program Files (x86)\\PuTTY\\plink.exe\" -R 3389:" + uri.Host + ":" + uri.Port + " -N -l username -pw"; // TODO pwd Process p = Process.Start(info); I tried the same think with calling plink.exe directly instead of cmd.exe /k, but the window closes immediately, which is unfortunate for bug-hunting. BUT when I pass a password in the arguments, plink.exe displays the program help (showing available parameters) and quits: Uri uri = omitted; ProcessStartInfo info = new ProcessStartInfo(); info.FileName = "cmd"; info.Arguments = "/k \"C:\\Program Files (x86)\\PuTTY\\plink.exe\" -R 3389:" + uri.Host + ":" + uri.Port + " -N -l username -pw secretpassword"; Process p = Process.Start(info); No indication of missing parameters. Both the cmd /k and plink.exe variants do not work (the latter closes immediately, so no information regarding different behaviour). When I launch the application from the Windows 7 Start Menu launcher with the identical parameters, it opens a cmd.exe window and establishes the connection as requested. What's wrong? Is there a way plink.exe notices it's not running in a real shell? If yes, how can I circumvent it, like the Start Menu "prompt" does? I hope this question is right on SO, since it, though specifically for a single application, revolves around launching it successfully programmatically.

    Read the article

  • Finding What You Need in R: function arguments/parameters from outside the function's package

    - by doug
    Often in R, there are a dozen functions scattered across as many packages--all of which have the same purpose but of course differ in accuracy, performance, theoretical rigor, and so on. How do you gather all of these in one place before you start your task? So for instance: the generic plot function. Setting secondary ticks is much easier (IMHO) using a function outside of the base package, minor.tick(nx=n, ny=n, tick.ratio=n), found in Hmisc. Of course, that doesn't show up in plot's docstring. Likewise, the data-input arguments to 'plot' can be supplied by an object returned from the function 'hexbin', again, from a library outside of the base installation (where 'plot' resides). What would be great obviously is a programmatic way to gather these function arguments from the various libraries and put them in a single namespace. edit: (trying to re-state my example just above more clearly:) the arguments to plot supplied in the base package for, e.g., setting the axis tick frequency are xaxp/yaxp; however, one can also set a/t/f via a function outside of the base package, again, as in the minor.tick function from the Hmisc package--but you wouldn't know that just from looking at the plot method signature. Is there a meta function in R for this? So far, as i come across them, i've been manually gathering them in a TextMate 'snippet' (along with the attendant library imports). This isn't that difficult or time consuming, but i can only update my snippet as i find out about these additional arguments/parameters. Is there a canonical R way to do this, or at least an easier way? Just in case that wasn't clear, i am not talking about the case where multiple packages provide functions directed to the same statistic or view (e.g., 'boxplot' in the base package; 'boxplot.matrix' in gplots; and 'bplots' in Rlab). What i am talking is the case in which the function name is the same across two or more packages.

    Read the article

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