Home Notices Documents Classes Download Others Rice
Classes  >  command  >  Add(string,long)
command class : Add(string,long) method

Description

Sets a value for the parameter.

Syntax

commandInstance.Add(string parameterName, long parameterValue)

Arguments

ClassNameDescription
stringparameterNameA parameter name.
longparameterValueA parameter value.

Return value

None.

Sample code

1:

connection cnn = new connection("Data Source=c:\somedirectory\somedatabase.sqlite3;Version=3;");

2:

cnn.Open();

3:

command cmm = new command("create table sometable (id int, name text);", cnn);

4:

cmm.NonQuery(); // Command execution. Create a table.

5:

cmm.CommandText = "insert into sometable values(@id, @name);";

6:

cmm.Add("@id", 1L);

7:

cmm.Add("@name", "name string");

8:

cmm.NonQuery(); // Command execution. Insert data.

9:

cmm.Release();

10:

cnn.Close();

11:

cnn.Release();

Notes

None.

Links for reference

None.

Copyright © Rice All rights reserved.