Thursday 15 May 2014

c# - 1 Paged Data Source with multiple datatables from a dataset -


I have a repeater that receives data from pageddatasrouce, it receives data from pageddatasource dataset, only one table in dataset I usually do this while using and now I would like to get the pageddatasource data from those 2 tables which are in the dataset in relation between them.

This is the code I usually use, working with 1 table in the dataset.

  PagedDataSource Pds = New PagedDataSource (); Pds.DataSource = myDataSet.Tables [0] .DefaultView; Pds.AllowPaging = True; Pds.PageSize = 2; Pds.CurrentPageIndex = Current Page; LblCurrentPage.Text = "Page:" + (current page + 1) .ostring () + "of" + PDS Page count.ToString (); // Disable the previous or next button if necessary cmdPrev.Enabled =! Pds.IsFirstPage; CmdNext.Enabled =! Pds.IsLastPage; Repeater 1 Data source = pds; Repeater1.DataBind (); I tried to use code for 2 codes below but it only uses Table 1, or if I flip them, then it will use Table 2.  
  Pds. DataSource = myDataSet.Tables [0] .DefaultView; // Table 1 Pds.DataSource = myDataSet.Tables [1] .DefaultView;  

Just my own problem has been fixed: )

Instead of requesting 2 separate datatables from the database and then adding a dataset, I used a Joy statement, resulting in both tables being added to 1 data and then a dataset Was added to.

The dataset was given to the dataset with 1 figure as I had posted in my question.

No comments:

Post a Comment