parameters

System.Data.SQLite parameter issue

I have the following code: try { //Create connection SQLiteConnection conn = DBConnection.OpenDB(); //Verify user input, normally you give dbType a size, but Text is an exception var uNavnParam = new SQLiteParameter("@uNavnParam", SqlDbType.Text) { Value = uNavn }; var bNavnParam = new SQLiteParameter("@bNavnParam"...

MS SQL Server - Invalid characters in parameter names.

I need to know what are invalid characters to use in a SQL parameter name. Given something simple like SELECT * FROM tblTest WHERE testid = @[X], if X contains a hyphen, for instance, the statement will fail. Can anyone give me a definitive list or point me in the direction of one. Thanks in advance. ...

Cannot retrieve output parameters from MSSQL stored procedure using PHP

I am executing a MSSQL stored procedure that is supposed to return an output parameter (ErrCode), as well as a resultset. I am calling the procedure from PHP using the following code, but so far have been unable to retrieve the output parameter: $stmt = mssql_init("addFaculty", $this->db); mssql_bind($stmt, "@FacultyID", $FacultyID, S...

Getting the name of the parameter passed into a method

Duplicate: http://stackoverflow.com/questions/742350/determine-the-name-of-the-variable-used-as-a-parameter-to-a-method Is there any way to retrieve the name of a parameter that was passed into a method e.g. int someParameter = 1; Method(someParameter); public void Method(int parameter) { // I want the name of 'parameter' which wi...

Is there a way to indicate the last n parameters in a batch file?

In the following example, I want to call a child batch file from a parent batch file and pass all of the remaining parameters to the child. C:\> parent.cmd child1 foo bar C:\> parent.cmd child2 baz zoop C:\> parent.cmd child3 a b c d e f g h i j k l m n o p q r s t u v w x y z Inside parent.cmd, I need to strip %1 off the list of para...

Best Way to Handle SQL Parameters?

This is really a VB.NET/C# question. Ok, so I essentially have a database layer that is totally isolated from any business logic. This means that whenever I get ready to commit some business data to a database, I have to pass all of the business properties into the data method's parameter. For example: Public Function Commit(foo as o...

Using MDX Parameters in Report Builder 2.0

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON 0, NON EMPTY (([ENROLL DATE].[CALENDAR].[YEAR].[" + Parameters!EnrollDate.Value + "] * [DIM ENROLLMENT].[ENROLLMENT].[ENROLLMENT PROG].ALLMEMBERS)) ON 1 FROM (SELECT (([DIM ENROLLMENT].[ENROLLMENT].[TERMINATION REASON].[Still Enrolled])) ON 0...

Can I pass parameters from and external .swf using Actionscript 3.0?

I have a main .fla file that I am using to load a sequence of three games. If the user wins a game, they go on to the next game. Is it in any way possible to pass to the main project whether the user has won the game? I have tried using loader.content, but that does not seem to be working. I am using Flash CS3. ...

Passing an array as an argument in C++

I'm writing a merge sort function, and right now I am just using a test case array (there is no input - this is static, for now). I don't know how to pass an array as an argument. Here is my code right now: //merge sort first attempt #include <iostream> #include <algorithm> #include <vector> int mergeSort(int[]); int main() { int orig...

Calculating a T-SQL Query Parameter at Load Time

I'm trying to SELECT records out of an Events Database (with an EventDate field as Date) that have a EventDate that is in the current month. I have functions for calculating the first day of the month: public string GetFirstofMonth(DateTime dt) { int thisMonth = dt.Month; int thisYear = dt.Year; string firstOfMonth = thisMonth.ToStr...

How should I pass a user-defined type to SqlParameterCollection.AddWithValue?

I have a custom data type called StudentID, which has an implicit conversion to string. When I pass a StudentID instance to SqlCommand.Parameters.AddWithValue (as the value) and execute the command, I receive the following error: "No mapping exists from object type StudentID to a known managed provider native type." Specifying a type ...

C++ Style Convention: Parameter Names within Class Declaration

Hello. I'm a fairly new C++ programmer and I would like to hear the arguments for and against naming parameters within the class declaration. Here's an example: Student.h #ifndef STUDENT_H_ #define STUDENT_H_ #include <string> using namespace std; class Student { private: string name; unsigned int age; float h...

Is it possible to make a parameter implement two interfaces?

Is it possible to define a function that takes in a parameter that must implement two interfaces? (The two interfaces are ones I just remembered off the top of my head; not the ones I want to use) private void DoSomthing(IComparable, ICollection input) { } ...

Sane/fast method to pass variable parameter lists to SqlServer2008 stored procedure

A fairly comprehensive query of the brain has turned up a thousand and one ways to pass variable length parameter lists that involve such methods as: CLR based methods for parsing strings to lists of integers Table valued functions that require the presence of a 'Numbers' table (wtf?) Passing the data as XML Our requirements are to p...

How to make a linkbutton onclick with parameters

HTML : <asp:LinkButton ID="lnk_productImage" runat="server" Text="select" OnClick="viewProductImage('<%#DataBinder.Eval(Container.DataItem,"Id") %>')" > </asp:LinkButton> CodeBehind: protected void viewProductImage(object sender, EventArgs e, int id) { //Load Product Image } ...

How to call the method from a MethodCallExpression in c#

Hello, I have a method call expression and try to invoke the method. I figured out a way, but I have problems in retrieving the parameter values since not every argument is described with a ConstantExpression. Expression<Action<T>> = t => t.DoSomething(Par0, Par1, Par2); MethodCallExpression methodCallExpression = selector.Body as Meth...

Create PopUp with <asp:HyperLink> that is passing paramters

This HyperLink syntax is not working to pass parameters to a small PopUp window: <asp:HyperLink ID="HyperLink2" runat="server" Text="Manage Related Items" NavigateUrl='<%# "editRelatedItems.aspx?" + "ProductSID=" + Eval("ProductSID") + "&CollectionTypeID=" + Eval("CollectionTypeID")+ "&ProductTypeID=" + Eval("ProductTypeID") %>' oncl...

When to use environment variable or command line parameter?

When to use environment variable or command line parameter? I think there are two ways to pass parameters to another process in a script ,environment variable and command line parameters. Thus,in which condition we choose one instead of another? ...

Passing a particular WebControl type as a parameter in VB.net

I'm trying to create a function that searches up a WebControl's parent-child relationship (basically the opposite of WebControl.FindControl(id as String), but looking for a specific WebControl type). Example: I have a user control in an ItemTemplate for a GridViewRow. I'm trying to reference the GridViewRow from the user control. The ...

Struts 2: parameters between Actions

Hello everyone! I have the following question: I need to pass a parameter (for example ID ) when I finish a form and the action save the form's values, this will forward to the result = "success" and I need that the action that will be call in the success come with the ID and other parameters to later use in the next form for save this ...