J
Jeverson
Hi All,
I'm tryin' to create a new DataAdapter class. This class
inherits from System.Data.Common.DbDataAdapter and
implements the following interfaces: IDbDataAdapter and
ICloneable.
Here is the class declaration and a simplified version of
the constructor called by VS.NET:
[Serializable()]
public class PIDataAdapter :
System.Data.Common.DbDataAdapter, IDbDataAdapter,
ICloneable
{
public PIDataAdapter()
{
try
{
this.mobjSqlDataAdapter = new
System.Data.SqlClient.SqlDataAdapter();
this.miAdapter = (IDbDataAdapter) this.mobjSqlDataAdapter;
this.SelectCommand = (IDbCommand) new
System.Data.SqlClient.SqlCommand();
}
catch
{
}
}
.... }
The code compiles ok and I can even add an instance of
this class to a web form designer, but there are some
things that are not Ok. Here are they:
1. The SelectCommand property of the class doesn't get
initialized in the code-behind file of the page I add it
to. Is the constructor the right place for doing this? or
do I have to catch any event for doing the initialization?
How to write the values of the initialization in the code-
behind file of the page where I add the component?
2. When I right click the PIDataAdapter instance, the
following options are NOT present in the context menu:
Configure DataAdapter..., Generate Dateset..., Preview
Data...
What am I doing wrong? Could anyone please help me?
I've spent a lot of time trying to figure out what is
wrong but didn't get anywhere ...
Thanks in advance,
Best Regards,
Jeverson
I'm tryin' to create a new DataAdapter class. This class
inherits from System.Data.Common.DbDataAdapter and
implements the following interfaces: IDbDataAdapter and
ICloneable.
Here is the class declaration and a simplified version of
the constructor called by VS.NET:
[Serializable()]
public class PIDataAdapter :
System.Data.Common.DbDataAdapter, IDbDataAdapter,
ICloneable
{
public PIDataAdapter()
{
try
{
this.mobjSqlDataAdapter = new
System.Data.SqlClient.SqlDataAdapter();
this.miAdapter = (IDbDataAdapter) this.mobjSqlDataAdapter;
this.SelectCommand = (IDbCommand) new
System.Data.SqlClient.SqlCommand();
}
catch
{
}
}
.... }
The code compiles ok and I can even add an instance of
this class to a web form designer, but there are some
things that are not Ok. Here are they:
1. The SelectCommand property of the class doesn't get
initialized in the code-behind file of the page I add it
to. Is the constructor the right place for doing this? or
do I have to catch any event for doing the initialization?
How to write the values of the initialization in the code-
behind file of the page where I add the component?
2. When I right click the PIDataAdapter instance, the
following options are NOT present in the context menu:
Configure DataAdapter..., Generate Dateset..., Preview
Data...
What am I doing wrong? Could anyone please help me?
I've spent a lot of time trying to figure out what is
wrong but didn't get anywhere ...
Thanks in advance,
Best Regards,
Jeverson