New to Telerik ReportingStart a free 30-day trial

Represents an SQL database to data items.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

C#
public class SqlDataSource : DataSource, IDataSource

Inheritance: objectMarshalByRefObjectComponentDataSourceSqlDataSource

Implements: IDataSource

Inherited Members DataSource.NameDataSource.DescriptionDataSource.CalculatedFields

Constructors

Initializes a new instance of the SqlDataSource class.

C#
public SqlDataSource()

Initializes a new instance of the SqlDataSource class.

C#
public SqlDataSource(string providerName, string connectionString, string selectCommand, SqlDataSourceCommandType selectCommandType, string schemaRestrictions)
Parameters:providerNamestring

Specifies the managed provider name used to connect to data.

connectionStringstring

Specifies the connection string used to connect to data.

selectCommandstring

Specifies the SQL select statement or stored procedure to execute.

selectCommandTypeSqlDataSourceCommandType

Specifies how the select command string to be interpreted.

schemaRestrictionsstring

Specifies the schema restrictions used by the query builder while resolving the database schema.

Initializes a new instance of the SqlDataSource class.

C#
public SqlDataSource(string providerName, string connectionString, string selectCommand, string schemaRestrictions)
Parameters:providerNamestring

Specifies the managed provider name used to connect to data.

connectionStringstring

Specifies the connection string used to connect to data.

selectCommandstring

Specifies the SQL select statement or stored procedure to execute.

schemaRestrictionsstring

Specifies the schema restrictions used by the query builder while resolving the database schema.

Initializes a new instance of the SqlDataSource class.

C#
public SqlDataSource(string providerName, string connectionString, string selectCommand)
Parameters:providerNamestring

Specifies the managed provider name used to connect to data.

connectionStringstring

Specifies the connection string used to connect to data.

selectCommandstring

Specifies the SQL select statement or stored procedure to execute.

Initializes a new instance of the SqlDataSource class.

C#
public SqlDataSource(string connectionString, string selectCommand)
Parameters:connectionStringstring

Specifies the connection string used to connect to data.

selectCommandstring

Specifies the SQL select statement or stored procedure to execute.

Properties

Gets or sets the wait time in seconds before terminating the attempt to retrieve data.

C#
public int CommandTimeout { get; set; }
Property Value:

The time in seconds to wait before terminating the attempt to retrieve data. The default value of the CommandTimeout property is 30 seconds.

Remarks:

The provided value should be valid for the currently used data provider.

Gets or sets the connection string used to connect to data.

C#
public string ConnectionString { get; set; }
Remarks:

The ConnectionString property contains either a valid connection string or the name of a ConnectionStringSettings in the application configuration file.

Gets a collection with data source parameters.

C#
public SqlDataSourceParameterCollection Parameters { get; }

Gets or sets the managed provider name used to connect to data.

C#
[TypeConverter("Telerik.Reporting.Data.Design.DataProviderNameConverter, Telerik.Reporting.Design, Version=20.1.26.615, Culture=neutral, PublicKeyToken=a9d7983dfcc261be")]
public string ProviderName { get; set; }
Remarks:

If the ProviderName property is set to null (Nothing in Visual Basic) or an empty string, the default provider is System.Data.SqlClient.

Gets or sets the schema restrictions used by the query builder while resolving the database schema.

C#
public string SchemaRestrictions { get; set; }
Remarks:

A comma-separated list of schema restrictions used to limit the amount of information returned. The position of each item in the list is equivalent to the restriction number.

Gets or sets the SQL select statement or stored procedure to execute.

C#
public string SelectCommand { get; set; }

Gets or sets a value indicating how the select command to be interpreted.

C#
public SqlDataSourceCommandType SelectCommandType { get; set; }
Remarks:

One of the SqlDataSourceCommandType enumeration values. The default value of the SelectCommandType property is Text.