Mimer SQL Data Provider
ParameterName Property (MimerParameter)
Example 




Mimer.Data.Client Namespace > MimerParameter Class : ParameterName Property
Gets or sets the name of the MimerParameter.
If value is non-null and non-empty, the system will:
  1. Try to match the parameter name with a parameter with the same name in the SQL command (eg. a host variable reference specified with a colon as :HOSTVAR).
  2. If the command text has parameters that have no equivalent in the MimerParameterCollection, it will pick unnamed parameters from the MimerParameterCollection instead.
  3. If the MimerParameterCollection has parameters that have no equivalent in the command text, the names will be discarded and the parameters will be handled as unnamed parameters.
If value is null or empty, it is handled like an unnamed parameter.
An integer is not a parameter name that will match a host variable in an SQL command (e.g. :1).
Instead it indicates the order in which to pick the parameters.
It is recommended to use either unnamed or named parameters and not mix them in the same command.
Syntax
'Declaration
 
Public Overrides NotOverridable Property ParameterName As String
public override string ParameterName {get; set;}
public read-write property ParameterName: String; override; 
public override function get,set ParameterName : String
public: __property string* get_ParameterName() override;
public: __property void set_ParameterName( 
   string* value
) override;

Property Value

The name of the MimerParameter. The default value is an empty string ("").
Example

No example is available for C++, JScript or Visual Basic. To view a C# example, click the Language Filter button in the upper-left corner of the page.

MimerCommand command = new MimerCommand();
            
// 
//  Perform insert with named parameters.
// 
command.CommandText = "INSERT INTO TAB VALUES(:c1,:c2);"
command.Parameters.Add("c2", "bar");
command.Parameters.Add("c1", "foo");
            
//  The above code will match the parameter names and do the following:
//  INSERT INTO TAB VALUES('foo','bar');
            
            
// 
//  Perform insert with named parameters that do not match.
// 
command.CommandText = "INSERT INTO TAB VALUES(:c1,:c2);"
command.Parameters.Add("c3", "bar");
command.Parameters.Add("c4", "foo");
            
//  The above code will fail to match the parameter names and do the following:
//  INSERT INTO TAB VALUES('bar','foo');
//  as unnamed parameters are read from the collection in the order they appear.
            
            
// 
//  Perform insert with unnamed parameters.
// 
command.CommandText = "INSERT INTO TAB VALUES(?,?);"
command.Parameters.Add("", "foo");
command.Parameters.Add("", "bar");
            
//  The above code will read the parameter collection in the order the parameters appear:
//  INSERT INTO TAB VALUES('foo','bar');
            
            
// 
//  Perform insert with parameters with a specific position.
// 
command.CommandText = "INSERT INTO TAB VALUES(:2,:1);"
command.Parameters.Add("", "bar");
command.Parameters.Add("", "foo");
            
//  The above code will read the parameter collection in the order specified in the command text:
//  INSERT INTO TAB VALUES('foo','bar');
Requirements

.NET Framework
Version 2.0 or later

See Also

Reference

MimerParameter Class
MimerParameter Members