command class : Add(string,long) method

Description

Sets a value for the parameter.

Syntax

instance.Add(string name, long value)

Arguments

ClassNameDescription
stringnameName.
longvalueValue.

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(); // Creates the "sometable".

5:

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

6:

cmm.Add("@id", 1L); // Sets 1 to the "@id". This 1 is long value.

7:

cmm.Add("@name", "name string"); // Sets "name string" to the "@name".

8:

cmm.NonQuery(); // Data inserting is done.

9:

cmm.Release();

10:

cnn.Close();

11:

cnn.Release();

Notes

None.

Links for reference

None.

Copyright © Cooker All rights reserved.