combit List & Label 25 - .NET Online Web Help
SqlConnectionDataProvider Constructor(SqlConnection,ReadOnlyCollection<String>)
Example 


combit.ListLabel25.DataProviders Namespace > SqlConnectionDataProvider Class > SqlConnectionDataProvider Constructor : SqlConnectionDataProvider Constructor(SqlConnection,ReadOnlyCollection<String>)
The connection to use.
The list of allowed table schemas.
Initializes the data provider to access all elements available from the connection that belong to the passed schemas.
Syntax
'Declaration
 
Public Function New( _
   ByVal connection As SqlConnection, _
   ByVal tableSchemas As ReadOnlyCollection(Of String) _
)
public SqlConnectionDataProvider( 
   SqlConnection connection,
   ReadOnlyCollection<string> tableSchemas
)
public:
SqlConnectionDataProvider( 
   SqlConnection^ connection,
   ReadOnlyCollection<String^>^ tableSchemas
)

Parameters

connection
The connection to use.
tableSchemas
The list of allowed table schemas.
Example
SqlConnection conn = new SqlConnection(Properties.Settings.Default.ConnectionString); 
List<string> schemas = new List<string>();
schemas.Add("Sales");
schemas.Add("HumanResources");
SqlConnectionDataProvider provider = new SqlConnectionDataProvider(conn, schemas.AsReadOnly());
provider.PrefixTableNameWithSchema = true;
LL.DataSource = provider;
LL.Design();
Dim conn As New SqlConnection(Properties.Settings.[Default].ConnectionString)
Dim schemas As New List(Of String)()
schemas.Add("Sales")
schemas.Add("HumanResources")
Dim provider As New SqlConnectionDataProvider(conn, schemas.AsReadOnly())
provider.PrefixTableNameWithSchema = True
LL.DataSource = provider
LL.Design()
Requirements

See Also

Reference

SqlConnectionDataProvider Class
SqlConnectionDataProvider Members
Overload List