ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

HasTables

Determina si un DataSet tiene DataTables con Datos.

Source

public static bool HasTables(this DataSet source) {
	bool lResult = false;
	if(source != null && source.Tables.Count > 0) {
		foreach(DataTable lDtTabla in source.Tables) {
			lResult = (lDtTabla != null && lDtTabla.Rows.Count > 0);
			if(lResultado) break;
		}
	}

	return lResult;
}

Example

DataSet DtSet = new DataSet();
if(DtSet.HasTables()){
	//your code...
}

Author: UlisexXx

Submitted on: 21 nov. 2023

Language: csharp

Type: System.Data

Views: 1291