c# - Set button to disabled when AccessDataSource has no rows -


I am bound to use a AccessDataSource control for a DetailsView control. When there are no selection rows (the details disappear, but still visible), then I would like to disable some more functionality and disable some more functionality.

Back in the C # code, I know that I need:

  buttonbab button. Competent = false;  

However, I am unsure of a way to get information from AccessDataSource or DetailsView which will tell me about setting prices.

I have seen some other articles suggesting examples for the same item:

  Datavive DV = (DataView) SqlDataSource1. Select (Data source processing. Int Readded Products = (Int) D.W.table.rise [0] [0]  

For me, due to the data view is not the correct namespace The error is in:

  using the system web; using System.Web.UI; using System.Web.UI.WebControls;  
< P> What should I do to disable the button?

(Though this is a real newbie question, this is not a school homework because it is the first comment so On all the simple questions.)

AccessDataSource gets from SqlDataSource class Therefore, it provides a program that is an event raised after the completion of the chosen work. The event type should have an EventArgs parameter.)

This EventArgs The parameter has an asset that will tell you the number of recovered lines. If this is 0, you can set the capable asset of your button.

  Private Zero Select non-selected handler (object source, SqlDataSourceStatusEventArgs e) {if (e.ffectedRows == 0) // button. }  

For the record, the DataView class System.Data remains in the namespace. In addition, calling on Select () on AccessDataSource would mean that you are running two selected statements, to get a record (if any), and another simply to retrieve records To calculate the number.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -