parameters

ADO.NET Update command with datetime parameter issue

Hi, I am trying do a database update via stored procedure using ADO.NET. Basically i setup all the parameter and command and have the one of the parameter set like the following DbParameter nm8 = provider.CreateParameter(); nm8.ParameterName = "@EDITDATE"; nm8.DbType = System.Data.DbType.DateTime; nm8.Value = aObject.ADateTime; comman...

How do I factorize a parameters repeats several times in my class?

Hello, I show you firsly my class : as you can see I repeated several times $versionId param because all the method needs it. I am asking myself if there is a way to factorize it so there is lesser repetition. <?php class Admin_Model_Version { private $_db; private $_versionId; private $_path; public function __construct() {...

Passing arrays to variable length argument lists

If I have a function void Foo(params int[] bar){} The following runs fine: int[] a1 = {1, 2, 3}; int[] a2 = {4, 5, 6}; Foo(1, 2, 3); Foo(a1); But these give compile errors: Foo(a1, 1, 2, 3); Foo(1, 2, a1); Foo(1, a1, 2); Foo(a1, a2, 1, 2, 3); because only the first argument is allowed to be an int[], the rest have to be ints. ...

Reflection: How to Invoke Method with parameters

Hello, I am trying to invoke a method via reflection with parameters and I get "object does not match target type". If I invoke a method without parameters it works fine. Based on the following code if I call the method Test("TestNoParameters") it works fine. However if I call Test("Run") I got an exception. Is something wrong with my c...

Difference between value parameter and reference parameter ?

Difference between value parameter and reference parameter ? This question is asked sometime by interviewers during my interviews. Can someone tell me the exact difference that is easy to explain with example? And is reference parameter and pointer parameter are same thing ? Thanks ...

How to get odd numbers of parameters in Zend Framework?

Greetings everyone Using the request object, I can't get a sole value as in this URI: http://mydomain.com/controller/action/value1 Using $request->getParams() is not returning the value1. Output: array([controller] => 'controller', [action] => 'action') The key is missing. The issue itself is quite simple and I could parse the U...

ASMX Webservice dropping incoming parameters

I need some help figuring out how to troubleshoot a problem with an ASP.Net 2 asmx webservice which seems to be ignoring incoming params. I have an ASMX service that takes a string, does a little work with an SAP API, and returns the results of the operation as a string. It works fine in a dev environment, but fails in production becau...

Reading request parameters in Python

Hi All I am very new to python and having to get into this stuff for a simple program to integrate with an ASP.NET application that I am building. The pseudo code is as follows. Get two parameters from request. (A ASP.NET will be calling this url by POST and sending two parameters) Internally execute some business logic and build some...

Get parameters of .js file

Hello, I have a javascript file that I reference in HTML with standard <script src="foo.js?param"></script>. In the file I want to distinguish e.g. loading the file with foo.js from foo.js?auto and foo.js?noauto=true, but not if the file is renamed to bar.js and referenced with the same parameter. How can I accomplish this, preferably n...

Passing primitive types as out param in Java

I need to return/update a boolean while returning a list of stuff from a method. Java can't return tuples and I didn’t want to make a separate class for this, so figured I would pass the bool as an out param. That’s what our C++ client does, passes bool by reference. That would work for a normal class since java sort of has pass-by-re...

Pass Parameters to an Image Binding

I have several menu items like this: <navigation:RadMenuItem Header="New Assignment"> <navigation:RadMenuItem.Icon> <Image Source="/Images/New_Assignment.jpeg" Width="20" Height="20" /> </navigation:RadMenuItem.Icon> </navigation:RadMenuItem> <navigation:RadMenuItem Header="New Course"> <navigation:RadMenuItem.Icon...

ASP.NET MVC routing conflict - null value for input variable

I'm at a loss as to why my routes are conflicting. I have these in my Global.asax file: routes.MapRoute( "CustomerView", "{controller}/{action}/{username}", new { controller = "Home", action = "Index", username = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", ne...

Passing Javascript parameters between functions

Hi all, Is the following possible: function one(parameterOne) { document.write('P1 = '+parameterOne+'); } function two(parameterTwo) { document.write('P2 = '+parameterTwo+'); } function three(parameterOne,parameterTwo) { this.parameterOne=parameterOne; this.parameterTwo=parameterTwo; x=parameterOne+parameterTwo; document.write(x); }...

Rails/jquery passing a variable(IDs) collected in jQuery to a rails controller/action

Hi everybody, I am new to AJAX and jQuery so please excuse me if this is kind of basic: I implemented the great jgrid by 2dconcepts (http://www.2dconcept.com/jquery-grid-rails-plugin). Now I would like to select the data in my table with the checkbox, - get the product ids (that works fine I see the alert from the 'handleSelection') ...

Dynamically injecting a parameter into a function call in c#

I was wondering if it was possible to dynamically inject a function parameter at runtime. For e.g. I have a class with two overloaded methods say Class C1 { public static void Func1(object o) { } public static void Func1() { } } Class C2 { public void Func1() { C1.Func1(); } } Now,...

Passing a local variable to a hidden_field in a partial

Hi I am trying to pass these local parameters to a partial form, and they are being passed to hidden_fields. I can't put the values straight into the forms because they will change. Any help would be greatly appreciated. I have: <% form_for :user, @user, :url => { :action => "create", :controller => "users"} do |f| %> <%= f....

Crystal/Oracle parameterized query to use variable

I currently have a Database Command object in my Crystal Report that looks something like SELECT * FROM table WHERE field = {?EndDate} I want to change it so it looks more like IF {?EndDate} = DATE '1900-01-01' MyVariable = ADD_MONTHS(LAST_DAY(SYSDATE), -1) ELSE MyVariable = {?EndDate} SELECT * FROM table W...

How to clear the parameter cache of a sql command?

I'm using Enterprise Library's DAAB. I have code like this: Database dBase = DatabaseFactory.CreateDatabase(); DbCommand dCommand = dBase.GetStoredProcCommand(StoredProcedureName, Parameters); dCommand.CommandTimeout = CommandTimeout; return dBase.ExecuteDataSet(dCommand); How can I clear the paramete...

quick-and-dirty way to pass a method with parameters, as a parameter?

Let me just preface this with the fact that I'm pretty green to C#. That being said, I'm looking for a way to pass a method with a parameters as a parameter. Ideally, what I want to do is: static void Main(string[] args) { methodQueue ( methodOne( x, y )); } static void methodOne (var x, var y) { //...do stuff } static void ...

How can I pass value to Perl Subroutine parameters on command line?

Hi. my test.pl script as below. #!C:\Perl\bin\perl.exe use strict; use warnings; sub printargs { print "@_\n"; } &printargs("hello", "world"); # Example prints "hello world" If I replaced printargs("hello", "world"); with print($a, $b);. How to pass 'hello' ,'world' to $a , $b when I run perl test.pl hello world at comman...