See Also

UniCommand Class  | UniCommand Members  | CommandText Property  | CommandType Property

Language

Visual Basic

C#

Show All

See AlsoLanguagesDevart.Data.UniversalSend comments on this topic.

Connection Property

Devart.Data.Universal Namespace > UniCommand Class : Connection Property (UniCommand)

Gets or sets the UniConnection used by this instance of the UniCommand.

[Visual Basic]
Public Property Connection As UniConnection
[C#]
public UniConnection Connection {get; set;}

Return Type

The connection to a database. The default value is a null reference.

Remarks

UniConnection specified in this property will carry out all operations executed with this UniCommand.

Example

The following example creates a UniCommand and sets some of its properties.

[C#] 

public void CreateCommand() 

  string mySelectQuery = "SELECT * FROM Test.Dept ORDER BY DeptNo"; 
  UniCommand myCommand = new UniCommand(mySelectQuery); 
  myCommand.Connection = new UniConnection 
    ("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa"); 
  myCommand.CommandType = System.Data.CommandType.Text; 

[Visual Basic] 

Public Sub CreateCommand()
  Dim mySelectQuery As String = _
    "SELECT * FROM Test.Dept ORDER BY DeptNo"
  Dim myCommand As New UniCommand(mySelectQuery)
  myCommand.Connection = New UniConnection _
    ("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa")
  myCommand.CommandType = System.Data.CommandType.Text
End Sub

See Also

UniCommand Class  | UniCommand Members  | CommandText Property  | CommandType Property

 

 


© 2002 - 2013 Devart. All Rights Reserved.