I assume that the method If sqlObj.sel_all_airlines
returns a DataSet
. Then you want to check if there's at least one row in the first table (side-note: it's probably more appropriate to return a DataTable
instead).
It's often easier to understand, maintain or extend (or just translate to C#) if you use a variable in between, for example:
VB.NET
Dim companyTable As DataTable = sqlObj.sel_all_airlines(row("COMPANY")).Tables(0)
If companyTable.Rows.Count > 1 Then
' ...
C#
DataTable companyTable = sqlObj.sel_all_airlines(row["COMPANY"]).Tables[0];
if(companyTable.Rows.Count > 1)
{
// ...
You should also set Option Strict
and Option Explicit
to ON in the project's compiler settings. Then you have to fix several compiler errors and warning. But it's worth it because it provides strong typing, prevents unintended type conversions with data loss, disallows late binding, and improves performance, its use is strongly recommended.
The code is also much more like C# afterwards (apart from the syntax).