I was writing code like this .

 
 
Sub Main
    Dim dr As DataRow = New DataRow()
End Sub
 

The IDE reminds me that there is an error.

 
'System.Data.DataRow.Protected Friend Sub New(builder As System.Data.DataRowBuilder)' is not accessible in this context because it is 'Protected Friend'.

The Friend modifier

Method modified with Friend only reachable for the other classes in the same assembly.

DataRow don't provide any default public constructor, its impossible to instantiate a DataRow instance outside the assembly of this class.

How to instantiate DataRow instance in right way

Browsing the definition of DataRow class you will find that it didn't provide any Public constructor, means you can not New it outside .NET framework.

According to MSDN

 
 "Initializes a new instance of the DataRow. Constructs a row from the builder. Only for internal usage."
 

The right way to instantiate DataRow instance is through DataTable's NewRow method.

 
DataTable dataTable = new DataTable();
dataTable.Column.Add("C1"); 
dataTable.Column.Add("C2");
...
Dim dr As DataRow  = dataTable.NewRow()
 
 

Only the DataTable knows how many columns a DataRow should has, its responsible for instantiating DataRow instance.