A non-visual component should derive from Control and not from UserControl
You can take controls like DataAdapter and SqlConnection, write properties
and methods that you want to expose and add it to the toolbox of client
project.
The code for component can contain properties and methods as follows:
public DataTable OrdersTable
{
get { return dsOrders1.Orders; }
}
public DataTable OrderDetailsTable
{
get { return dsOrders1.Order_Details; }
}
public DataRowCollection GetOrders(string custId)
{
daOrders.SelectCommand.CommandText = "select * from Orders where
customerId = '" + custId + "'";
daOrders.Fill(dsOrders1, "Orders");
return dsOrders1.Orders.Rows;
}
Hope this helps.
Sameeksha
(MCAD.Net)
"nht" wrote:
Hi, i have a question. I want to create my own components in C#. But i
want to create non visual components like datasets,data adapters etc.
How can i do that? From which class i must inherit my component?