Click here to Skip to main content
15,890,882 members
Everything / Parameter

Parameter

Parameter

Great Reads

by Sergey Alexandrovich Kryukov
Rather insane yet simple approach to the named function parameters
by Uladzislau Baryshchyk
An overview of Dynamic Language Runtime DLR in C#
by Mel Padden
Default keyword in SQL Server
by ToughDev
How to identify used and unused resources in VS Project Resources.resx file

Latest Articles

by Coral Kashri
Fold-expressions in extreme cases
by ToughDev
How to identify used and unused resources in VS Project Resources.resx file
by Illya Reznykov
The post describes PowerShell script which creates WAF resources for the scenario when Application Load Balancer is used to serve content for a public website, but to block requests from attackers and to protect from OWASP Top 10 security risks.
by Uladzislau Baryshchyk
An overview of multithreading in C#

All Articles

Sort by Title

Parameter 

25 Jul 2023 by Raf-Reyes
I'm new in VB.NET and I want to pass the value from vb.net to crystal report. I have a problem that the "Enter Parameter Value" keep asking a value even in my code there's already a value. When I remove this code I know "Enter Parameter Value"...
25 Jul 2023 by OriginalGriff
None of that code sets anything in report_Batch other than the two parameters. So at a guess, the command string (which we can't see) that the report is based on contains parameters you aren't setting. Use the debugger: find out exactly what...
17 Sep 2013 by YourAverageCoder
Hi, my question is about "this" keyword's meaning in Extension methods. Here's an example from http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx[^]:public static class ScottGuExtensions{ public static bool IsValidEmailAddress(this...
17 Sep 2013 by Zoltán Zörgő
It is a matter of syntax. The "this" keyword is only marking that you make an extension method for the type of that parameter. But I like this syntax because it is really in line with the keyword's other usage.
17 Sep 2013 by Sergey Alexandrovich Kryukov
No, it won't mean the same thing, not even close. Every parameter counts and make the difference. Without "this" how would you access the object you want to operate on.You are confused quite well. Probably, all you need it to read on the topic more carefully:...
17 Sep 2013 by phil.o
With the 'extension' method:public static class ScottGuExtensions{ public static bool IsValidEmailAddress(this string s) { Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"); return regex.IsMatch(s); }}you can use the method like...
17 Feb 2022 by Pete O'Hanlon
What is an array and how to use it to manage multiple items
17 Jul 2017 by The_Unknown_Member
Hi. I was experimenting with this and I found strange behaviour which I cant understand. Consider this code: #include "stdafx.h" void passStructAsParam(Student s); struct Student { int rollno; char gender; int age; }; int main() { Student s; s.rollno = 40; s.gender = 'm'; s.age =...
17 Jul 2017 by Jochen Arndt
When using the struct keyword in your function declaration you have a so called "forward declaration": // Forward declaration // Definition must be present later in this scope struct Student; // Can now use the forward declaration within other declarations void passStructAsParam(Student s); ...
24 Aug 2013 by Member 10229232
Dim serverSocket As New TcpListener(1200) Dim clientSocket As TcpClient Dim counter As Integer serverSocket.Start() msg("Chat Server Started.") counter = 0 While (True) counter += 1 clientSocket =...
24 Aug 2013 by Mahesh Bailwal
It seems like that dataFromClient does not contains "$" and that's why dataFromClient.IndexOf("$") is returning -1 which causing dataFromClient.Substring(0, dataFromClient.IndexOf("$")) to throw "Length cannot be less than zero" exception.Please debug and check it.
24 Aug 2013 by Member 10229232
I made it a little better for you to understand.
23 Jan 2023 by leone
Hi, My problem is that I cant send my custom object to OutputDataReceived method. Details: I have a class called Material which includes properties such as URL, Title, Description etc. Now I start a Process. My goal is to take Title by using...
23 Jan 2023 by leone
Ok I did it on my own: Material m=new Material(URL); process.OutputDataReceived +=(Object _sender, DataReceivedEventArgs _args)=>DoSomething(m, _sender, _args); public void DoSomething(Material mt,object sender, DataReceivedEventArgs e) { ...
14 Aug 2013 by Dev Leader
Don't forget about the non-public API
31 Mar 2015 by axeemg
protected void Button1_Click(object sender, EventArgs e) { con.Open(); SqlCommand cmd = new SqlCommand("sp_RptRouteWiseNetSaleDetails", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt...
23 Mar 2012 by Selim Sertaç BALCI
How to use delegates for async operations, pros and cons of it.
29 Nov 2021 by evedvvv
I have a program that currently distributes chocolates to x people in a list, and I have a general method that handles the sorting and several methods that orders the list by age, first name etc. depending on how you'd like to distribute the...
28 Nov 2021 by #realJSOP
You could do it this way: public void DistributeChocolatesByAge(int choc) { ChocolatesDistributed(choc, People.OrderBy(x => x.Age).ToList()); } However, I would probably move the sort operation into the ChocolatesDistributed method so...
28 Nov 2021 by Marc Clifton
Pass in the sort as a lambda: public void DistributeChocolates(int choc, Func sorter) { People = People.OrderBy(sorter).ToList(); ChocolatesDistributed(choc); } Call with: DistributeChocolates(5, x => x.Age);
29 Nov 2021 by Marc Clifton
Here's the full example. Not really sure what you're trying to do with numChocolates, but the rest of it illustrates passing in the order by expression. Note how it handles any type, such as int, string, double. It was interesting to figure...
22 Aug 2018 by Dinesh Kumar Dora
Hello friends, I am wondering if we can pass different count of commandline arguments to a console application. for example: test.exe test.exe arg1 test.exe arg1 arg2 test.exe arg1 arg2 arg3 all the above 4 cmdprompt invocations must work. Is it possible? i tried the params option as shown...
22 Aug 2018 by Richard MacCutchan
string argHTTPS = args[0]; string argCustDBName = args[1]; That will only ever work if you have two or more parameters. If you want it to be dynamic then you need check how many parameters are being passed in. Start by setting default values for all the optional parameters,...
22 Aug 2018 by Dave Kreskowiak
Your code doesn't make any sense. If the user doesn't pass in any args, it starts a Windows Forms app. If the user does pass in arguments, you add every argument to what appears to be a List (I have no idea because you never show the definition of mainObject!), assign the first two arguments to...
18 Jan 2016 by Member 11380736
c#Is it possible to send operators such as '' in method parameters?Public void change_color(Operator lessThan, Operator lessThan ){if(img.GetPixel(x, y).R lessThan 0 && img.GetPixel(x, y).G MoreThan 128 && img.GetPixel(x, y).B LessThan 110) { //do something }}
18 Jan 2016 by Dave Kreskowiak
Not the way you're sample is thinking, no.You'd be better off just creating a second method with the appropriate operators in place.Other methods are possible but they introduce performance hits on top of the bad code you're already writing.Get/SetPixel are VERY slow to execute once...
18 Jan 2016 by Sergey Alexandrovich Kryukov
You need to understand that an operator can be considered as syntactic sugar over the concept of method. For example, you are talking about binary operators; functionally, they are equivalent to a function accepting two arguments (each representing an operant) and returning the value. In your...
9 Nov 2018 by TheBigBearNow
current error: Object reference not set to an instance of an object I was getting invalid cast exception error but i changed (int) to Convert.toInt32 and that went away. I go to debug it and the on my button click and the code runs all the way through not stopping at any of my breakpoints. The...
9 Nov 2018 by OriginalGriff
The debugger is pretty much the only way you will find this: if you aren't hitting the breakpoints, then either they aren't in the right place, or you are not debugging the code you are executing. So: try it again. Go to the "Debug" menu and select the "Exceptions..." menu item. In the...
3 Jun 2015 by Sergey Alexandrovich Kryukov
Such software is the part of most C++ tools working with IDEs. For more advanced tools, please see: http://stackoverflow.com/questions/3265999/tool-for-tracing-c-program-execution[^].Many tools are proprietary.See also: http://en.wikipedia.org/wiki/List_of_performance_analysis_tools[^].—SA
17 Jun 2017 by User 11061201
Hallo community, i have currently this code in C++. I want to pass the reference of a void method so it can be called from another method in another class. //main.cpp #include "A" void Handler(int val); void Handler(int val) { printf("%d", val); //should display 5 } int main() { A fnc; ...
17 Jun 2017 by KarstenK
Using this technique in C++ is named callbacks. Here you find a tutorial about callbacks. As an experienced programmer like interfaces more, because type checking from the compiler, debugging adavantages and cleaner concepts like modularity and maintenance. Here you find some tutorial about...
20 Mar 2014 by Divakar Raj M
I want to call a method on two separate occasions. The two occasions pass two different types parameters, they differ by datatype. How do i achieve this without overloading.This is my codeusing System;using System.Collections.Generic;using System.Linq;using...
20 Mar 2014 by Divakar Raj M
Solved it..using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace DifferentDatatypeOfMethods{ class Program { static void Main(string[] args) { List intlist = new List(); ...
20 Mar 2014 by Tejas Vaishnav
Hi you can play like this...static void Main(string[] args) { List intlist = new List(); intlist.Add(2); intlist.Add(3); intlist.Add(7); List stringlist = new List(); ...
20 Mar 2014 by Kornfeld Eliyahu Peter
Read here about variable data type in C# (it's there since Visual Studio 2008/C# 3.0)...http://msdn.microsoft.com/en-us/library/bb383973(v=vs.120).aspx[^]
20 Mar 2014 by Matt T Heffron
Here's a start: public static void Hit(IList a) { Console.WriteLine(a[0]); }Both of the types of Lists you're using implement the IList interface.Without seeing what else you are doing I can't be sure, but using generics[^] looks like it may be a...
20 Mar 2014 by BillWoodruff
The easy way:private void TestHit(){ var intlist = new List {2, 3, 7}; var stringlist = new List {"A", "B", "C"}; Hit(intlist); Hit(stringlist);}private void Hit(List theList){ if (theList == null) throw new...
7 Apr 2013 by Member 9592868
I am using the HighStocks javascript library to create a chart on my website using finance data taken from Yahoo.I have an external javascript file with these functions: //uses AJAX call to retrieve data and then creates the chart with the data function createChart(ticker) { ...
9 Apr 2013 by Prasad Khandekar
Hello,Hello,Generally your URL will be fix, what's going to change is the data you will be sending, which can either be sent as query string parameters or as POST request parameters. Since you are using POST request, your code should look something like//uses AJAX call to retrieve data...
1 Oct 2013 by Rahul Krishnan R
Hi,I want to execute the below query using the parameters @Data and @Id taken from the UI.query = string.Format("update tablename set Confirmed=0 where data in (@Data) and id=@Id"); sqlParameters = new SqlParameter[2]; sqlParameters[0] =...
1 Oct 2013 by tanweer
hi,Update your query like this:query = string.Format("update tablename set Confirmed=0 where data in ('+CAST( (@Data) AS VARCHAR) +') and id=@Id"); sqlParameters = new SqlParameter[2]; sqlParameters[0] = new SqlParameter("@Data",...
1 Oct 2013 by Eon Malherbe
You are atempting dynamic SQL and SQL is trying to cast the @Data parameter to an integer value. Rather try something like this:query = string.Format("update tablename set Confirmed=0 where data in ({0}) and id=@Id", Convert.ToString(_data)); sqlParameters = new...
2 Oct 2013 by Ranesh M Raj
query = string.Format("update tablename set Confirmed=0 where data in ('+CAST( (@Data) AS VARCHAR(20)) +') and id=@Id"); sqlParameters = new SqlParameter[2]; sqlParameters[0] = new SqlParameter("@Data", SqlDbType.VarChar,20); ...
25 Dec 2010 by Chiranthaka Sampath
I have a program created using VB 2005 and MS Access 2003. In the program i have created a data grid which is connected using JET.4.0 OLEDB data provider. The data is been entered from text boxes to the data grid. I want to create a report using crystal report parameter passing which comes with...
22 Dec 2010 by fjdiewornncalwe
Try reading some of these articles.
28 Dec 2010 by Chiranthaka Sampath
I have a program created using VB 2005 and MS Access 2003. In the program i have created a data grid which is connected using JET.4.0 OLEDB data provider. The data is been entered from text boxes to the data grid. I want to create a report using crystal report parameter passing which comes with...
1 Jan 2011 by thatraja
Chiranthaka Sampath wrote:Am I on my own in here?Because most of people enjoying new year with their family & friends. Happy new year wishes for you.Ok here you go.How to pass discrete parameters to Crystal Reports[^]VB.NET Crystal Reports String parameter[^]Crystal Reports...
28 Jan 2011 by Chiranthaka Sampath
When creating crystal reports in VB 2005, passing parameters should I get one by one parameter for each field in the table which will be used for the creation of the crystal report? If so then how can I do that?
29 Jan 2011 by Sandeep Mewara
Have a look at these:Tip: How to pass Crystal Report Parameters Programmatically[^]How to pass discrete parameters to Crystal Reports[^]Passing Parameters to Crystal Reports at Runtime[^]If needed, go here[^] for more.
23 Nov 2011 by contact97438
Hello everyone,I want to save a Custom DateTimePicker.Value in my Application Settings. The custom format is : dd/MM/yyyy hh:mm:ss, instead of dd/MM/yyyy The field i've created in the application settings parameters is LASTSAVE (DATE / APPLICATION)When I try to link in the...
23 Nov 2011 by Richard MacCutchan
Don't save date and/or time values as strings; use System.DateTime[^] variables. In that way it will be valid for every system in the world; only when you need to display the value do you need to convert it to a readable string.
5 Apr 2011 by Red Baron 2
I'm creating a custom filter web part for SharePoint 2007 that presents a number of different filter that are then connected to parameters in an Excel Services Web Access web part. Just to make life harder I'm wrapping the controls in AJAX as well.I can get the connection to work, but...
8 Feb 2013 by Member 9742322
also at the end there was one bracket to many
8 Feb 2013 by Member 9742322
also at the end there was one bracket to manyand :DATETO)
29 Feb 2012 by bcasillas
hi all!i just want to know if it's possible to pass a datatable as sqlparameter, becasuse I do not want to use a for-each to insert row by row in my databasebest regards!!improving my questioni had not a particular problem, i just want to know if it's possible to do something...
29 Feb 2012 by Herman<T>.Instance
The SqlParamater.SqlDBType cannot be set to a DataTable object.See here[^]. You have to do rowbased updates.
31 May 2017 by Menci Lucio
Hi, I wrote a lot of parametrized queries where parameters are inserted by the user. If the user inserts strings longer than the field where parametrized value is referring to, DB2 throws a SQL0302N error. There is a way to avoid it? Example: Create Table Foo (Code Char(3) Not Null, Descr...
12 Jun 2011 by Mel Padden
Default keyword in SQL Server
10 Apr 2014 by HuggableAlien
Hello everyone!I am trying to make a compiler for a custom file format my editor uses, and I want it to be able to handle custom classes automatically. I already know how to find a class by name, but I want to know if it's possible to detect what parameters the classes constructor takes in, if...
15 Nov 2016 by abboudi_ammar
Good evening, I try to display an image in a reportViewer from a send path as a parameter. But the result I get is an image in X formWhat I have tried:public...
7 Oct 2017 by Member 11725507
Can we able to give it as a Optional variable in the below class. Because I don't want Obj1, obj2, obj3 for request type but needed for another request. Kindly suggest me. public Obj1 IsForecasted { get; set; } public obj2 ? IsGenerated { get; set; } public obj3 ? IsPosted...
7 Oct 2017 by OriginalGriff
You can't have optional data in a class - a class instance is a fixed size and cannot be altered. Think about it: you have a optional value which is not there for "mode == normal" - so you create an instance of the class as a "normal" instance. Later you change the value of mode to "advanced"...
7 Oct 2017 by Ralf Meier
For what do you need such "optional Variables" ? If your class should have this Variables for the usage 1 and needs not some Variables for usage 2 I don't understand the problem. If you don't need the Variables then don't use them. If the Variables (in your code-snippet I see them as Properties)...
8 Jan 2015 by Ali Albasri
Greetings to you allI have this table in asp.net and i`m creating dynamic rows for certain data of specific user, and I`m creating dynamic buttons for each row.I want to store each ID the of each row of the data in the button ID property of the button (because there is no tag property)...
8 Jan 2015 by OriginalGriff
Um...you did notice the sender parameter?Cast the sender as a Button, and you should be able to access the ID property for the specific button that was clicked.
30 Jan 2022 by Uladzislau Baryshchyk
An overview of Dynamic Language Runtime DLR in C#
30 May 2016 by Devil7DK
I have an patient report database, some of their values have database query constants like ' or " so i tried to insert these values using parameters. input was in English but when trying to retrieve the stored value it was returning a value of some kind of binary. the link for pictures and...
30 May 2016 by OriginalGriff
:sigh:Given that you have heard of parameterized queries, but you misuse them to store only those fields that give you a problem right now - and then you wonder why they don't work...Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL...
1 Aug 2014 by kk2014
hello,I have created a crystal report in CR8.5 already. now i want to export in my asp.net code instead creating new one in asp.net. how can i do it?is it possible? or i have to create a new one?Thanks
1 Aug 2014 by Abhinav S
Crystal reports does offer an export to excel feature -How to Export Crystal Report on Button Click in to PDF, Excel, Word, HTML, Rtf in ASP.NET C#.[^]How to Export Crystal Reports Without Using the Report Viewer[^]
26 Jan 2017 by markwhite1
Hi, I am trying to export crystal report in order to mail it. I have used : printbanqoute.ExportToDisk(ExportFormatType.PortableDocFormat, "E:\\ASD.pdf");However I get an error the "Missing Parameter Values".Without using ExportToDisc it works fine.I have used 4 parameters and...
26 Jan 2017 by markwhite1
I am able to solve my issue. I was writing all codes in `crystalviewer1_Load` event ie; exporting and email as well as populating data to crystal report. So I had to create a Button Email to export and email.Heres my code to export and email, Button1 is the email button on crystalviewer: ...
5 May 2015 by chandra sekhar
I have to fetch list of values from DB and display them in a dropdown, how can i fetch without passing anything.what to use in place of sqlparams??public List GetTimeZones(){ using (SqlDataReader dr = SqlHelper.ExecuteReader(DatabaseConnection.Connection,CommandType.Text,...
6 May 2015 by Harikrishna G
I guess you are looking for this,hope it will help youpublic DataTable GetAllEmployees() { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection(conString); try { SqlCommand cmd = new...
6 May 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You can return a DataTable and bind that directly. Let me update your code.public DataTable GetTimeZones(){ DataTable dtTimeZones = new DataTable(); SqlCommand cmd = new SqlCommand("sp_EP_GetTimeZones;", con); cmd.CommandType = CommandType.StoredProcedure; ...
22 Mar 2017 by FarhanShariff
I am try in to create a parser with to read configuration fileserror explicit specialisation in non namespace 'class Conversion'What I have tried:#include #include #include #include //holding the pair of parameter-value#include...
22 Mar 2017 by bling
Here are three choices for you:Easiest fix is to get rid of the Conversion class and write specialized versions of getValueOfKey.Alternative 2: make Conversion a template class (instead of a class with template members).template class Conversion {Alternative 3: make...
4 Jun 2012 by Makbg
Hello everyone,Can anyone tell me what does the fitt's law parameters a & b mean ? T = a + b log2(2D/W)
4 Jun 2012 by Manas Bhardwaj
According to Wikipedia[^]:1.) a represents the start/stop time of the device (intercept)2.) b stands for the inherent speed of the device (slope). These constants can be determined experimentally by fitting a straight line to measured data.
4 Jun 2012 by Richard MacCutchan
This is hardly a programming question; try reading this[^].
17 Jun 2013 by Radu-Stefan Zugravu
Hi,I am trying to send a float number as a function parameter in php.For example I have the following function:function my_function($my_float = 0.001) { print_r($my_float);}When print_r is executed I get the value of 100 not 0.001.Why is this happening and how...
22 Oct 2013 by thasneemjambi
I am Using a DataSet for Crystal Report. And that dataset contains a field call "Sector". And I am using Formula workshop(Record Selection) with parameter as well. if I pass "IT" as a parameter then all the rows will appear in crystal report which is contains "IT" in "Sector" field. Upto here...
19 Dec 2013 by Luiey Ichigo
Hi all,Is there any software to get the parameter on function available in a DLL? I've tried Depends, but it's only list the function that available in the API. I have the documentation of the DLL, but some of the function is not listed on the manual and I need to use it to send the Pointer...
19 Dec 2013 by OriginalGriff
For a native DLL file, there is no way I know of to extract the information, short of a full decompile as the information simply isn't stored in the file - just the number of bytes the parameters take up but not what type they are. If you think about it, it makes sense that it would be that way:...
13 Aug 2016 by Member 12564006
I have a script which pretend to create a form in my site and receive the response, let's call it script.py.This script needs to call a function in views.py:opc = newproject.views.Menu_Options(request, ask, Options)This function needs to use request.POST, so needs to receive "request"...
13 Aug 2016 by Member 12564006
I fixed it! I realised that I forgot to pass the "request" parameter when I call my script main funcion. That's why my external script "didn't know" what "request" was.
26 Jan 2018 by Member 13646380
Im sort of new to coding I want to add a parameter to a method but when I type it in, the jgrasp says no main method was found. I think it wants to see the public static void main(String[] args) but my teacher said I can put the method in instead. What I have tried: public static void...
26 Jan 2018 by OriginalGriff
You can't add parameters to main - it needs to have a specific signature - which means it needs to have very specific input and output parameters, and you adding or removing them changes the method signature and means that the system doesn't "see it" when it looks for the method to call at...
14 Oct 2020 by temchik_ggg
I'm trying to rewrite the Python algorithm in C++ and it doesn't work correctly. I think the problem is that I can't rewrite the function correctly in C++. How do I write a constant to a function (in Python, this is the 'start' parameter) or an...
10 Oct 2020 by KarstenK
best is to writeint Algorithm(int n, int start) to avoid confusion.
14 Oct 2020 by markkuk
The start parameter isn't a constant, it's a parameter with a default value. First, read about default argument values in Python[^] and in C++[^]. In C++ the default argument must be specified in the function declaration[^]. #include ...
23 Feb 2016 by Member 11820531
I have a team group parameter in my SSMS stored procedure. The team group parameter has 4 values. So far this is what I've coded:Declare @Param1 int = 1,@Param2 varchar(4) = '1169',@TeamGroup varchar(150) = 'RCBE,RLEG,RPEN,RSPC'-- Code below supports multi-select in reportif...
23 Feb 2016 by ZurdoDev
There are many ways to do it; however, one easy way would be to do something like this:SELECT value FROM HEA.Parselist(@TeamGroup, ',')UNION SELECT teamFROM TeamGroupsWHERE @TeamGroup = 'All'That would union in all your teams if @TeamGroup was a keyword of "All"
8 Jun 2017 by BeginnerCoderPete
I wanted a sub to create child forms but i am having issues Private Sub CreateChild(frm As Form) Dim frmChild As New frm frmChild.MdiParent = My.Forms.frmNavigation frmChild.Show() frmChild.Tag = My.Forms.frmNavigation.intTabCounter ...
8 Jun 2017 by Richard Deeming
Try using a generic method: Private Sub CreateChild(Of TForm As {Form, New})() Dim frmChild As New TForm() ... End Sub To call it, you need to specify the type of form you want to create: CreateChild(Of YourCustomForm)() The type must inherit from Form, and must have a public...
23 Jun 2014 by manishakc
I have a C# windows application, where i need to pass object created in python script - as argument to C# program and vice-verse. So how do i pass object created by Python script to C# program as parameter.For this, i don't want to use Iron-Python. My strict requirement is to use object...
25 Dec 2017 by R Hegde
struct queue{ int value; struct queue *tlink; struct queue *blink; }; typedef struct queue* Q; void enqueue(Q top, int val, Q bottom=NULL); error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token void enqueue(Q top, int val, Q bottom=NULL); What I have tried: I am trying to...
25 Dec 2017 by OriginalGriff
C doesn't have any concept of default parameters, so you pretty much can't do that. (Which is a lie-to-children, becuase you can, but it's horribly complicated and messy: C default arguments - Stack Overflow[^] - see BK's solution, which TBH is worse than the original problem from a...