See Also

SQLiteCommand Class  | SQLiteCommand Members  | SQLiteParameter Class  | CommandText Property


Visual Basic


Show All

See AlsoLanguagesDevart.Data.SQLiteSend comments on this topic.

Parameters Property

Devart.Data.SQLite Namespace > SQLiteCommand Class : Parameters Property

Gets or sets the SQLiteParameterCollection.

[Visual Basic]
Public ReadOnly Property Parameters As SQLiteParameterCollection
public SQLiteParameterCollection Parameters {get;}

Return Type

The parameters of a SQL statement. The default value is an empty collection.


By default, you have to construct this collection and provide values for it manually. However, if you choose to use autosynchronization mode by setting Devart.Common.DbCommandBase.ParameterCheck property to true you can have the collecton adjusted automatically. Please refer to article Using Parameters in dotConnect for SQLite for detailed information on using this mode.


The following example creates a SQLiteConnection, SQLiteCommand, fills its parameters and displays them. An UPDATE statement with the parameters involved is executed then.


static void CreateCommand(SQLiteConnection sqConnection, string mySelectQuery, SQLiteParameter[] myParamArray) 

  SQLiteCommand sqCommand = new SQLiteCommand(mySelectQuery, sqConnection); 
  string myMessage = ""; 
  for (int i = 0; i < myParamArray.Length; i++) 
    myMessage += sqCommand.Parameters[i].ToString() + "\n"; 

static void Main(string[] args) 

  SQLiteParameter[] myParams = new SQLiteParameter[]  
      new SQLiteParameter("DeptNo", 10), 
      new SQLiteParameter("DName", "COUNTING") 
  SQLiteConnection sqConnection1 = new SQLiteConnection( 
  CreateCommand(sqConnection1,"UPDATE Dept SET DName = :DName WHERE DeptNo = :DeptNo",myParams); 

[Visual Basic] 

Public Sub CreateCommand(ByVal sqConnection As Devart.Data.SQLite.SQLiteConnection, _
 ByVal mySelectQuery As String, ByVal myParamArray() As Devart.Data.SQLite.SQLiteParameter)
  Dim sqCommand As New Devart.Data.SQLite.SQLiteCommand(mySelectQuery, sqConnection)
  Dim myMessage As String = ""
  Dim i As Integer
  For i = 0 To (myParamArray.Length - 1)
    myMessage = String.Concat(myMessage, " ", sqCommand.Parameters(i).ToString())
  End Try
End Sub

Sub Main()
  Dim myP1 As New Devart.Data.SQLite.SQLiteParameter
  myP1.ParameterName = "DeptNo"
  myP1.Value = 10
  Dim myP2 As New Devart.Data.SQLite.SQLiteParameter
  myP2.ParameterName = "DName"
  myP2.Value = "ACCOUNTING"
  Dim myParams(1) As Devart.Data.SQLite.SQLiteParameter
  myParams(0) = myP1
  myParams(1) = myP2
  Dim sqConnection1 As New Devart.Data.SQLite.SQLiteConnection( _
  CreateCommand(sqConnection1, "UPDATE Dept SET DName = :DName WHERE DeptNo = :DeptNo", myParams)
End Sub

See Also

SQLiteCommand Class  | SQLiteCommand Members  | SQLiteParameter Class  | CommandText Property



© 2008 - 2016 Devart. All Rights Reserved.