Let me give you a simple explanation. Although not entirely right. But I can make you understand what the effect of out is. Oh
Let me give you an example. Each method can have only one return value. But you want to have multiple return values, huh. Out is working. such as paging, not only to return data, but also to return the total number of records
Such as:
Public DataSet getData (out int count)
{
DataSet Ds=bll.getdata (10,20);
Get 11th to 20th data: But it's not possible to show only a total of 10 records. Oh. Then we're going to use out.
int RCOUNT=BLL. GetCount ();//For example, this is the total number of records taken.
Count=rcount;
return DS;
}
When it is displayed
public void ShowData ()
{
int count=0;
Gridview1.datasource=getdata (out count);
Gridview1.databind ();
label1.text= "Total" +count.tostring () + "records";
}
The role of Out parameters in C #