Select() is being called automatically

  • Thread starter Thread starter Steven Blair
  • Start date Start date
S

Steven Blair

Hi,

I am using a SqlDataSource and a FormView.
The problem I have is I need to call SqlDataSource.Select() manually (I
need to grab the DataSet). However, the FormView appears to call
.Select() as well.

Can I stop this from happening so the Select() is only called when I
decide.

I don't want to disconnect the SqlDataSource and the FormView since I
can easily add / remove columns. This is possibly the only way I cna
think of doing it, if SDS and FormView were disconnected I could do
this:

1. Call .Select
2. Set the DataSource of the FormView to the DataSet
3. Call .DataBind()

Any help on this matter would be appreciated.

Steven
 
I may have found a work around:

FormView1.DataSourceID = null;

DataSet ds =
((DataView)sbsTest.Select(DataSourceSelectArguments.Empty)).Table.DataSe
t;

FormView1.DataSource = ds;
FormView1.DataBind();

When I want to Insert or Update, I call Insert() or Update() manually.

Anyone see any problems with this approach?

Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top