I am getting below Error
“Update requires a valid InsertCommand when passed DataRow collection with new rows.”

Below is the code in Module
Module ModDBConnection

Public CnCommon As New SqlConnection

Public DTCodeMaster As New DataTable
Public DACodeMaster As New SqlDataAdapter
Public CBCodeMaster As New SqlCommandBuilder

Public Sub CommonCn()
CnCommon = New SqlConnection
CnCommon.ConnectionString = "Data Source=DELTA\SQL_PRAVIN;Initial CatAlog=PAYDATANET;User ID=accounts;Password=accounts"
End Sub

Public Sub RSCodeMaster()
Call CommonCn()
Dim Sas As String = "SELECT * FROM Tbl_AccountMaster "
Dim DACodeMaster = New SqlClient.SqlDataAdapter(Sas, CnCommon)
Dim CBCodeMaster = New SqlClient.SqlCommandBuilder(DACodeMaster)
End Sub

End Module

Below code is on my form

Call RSCodeMaster()
Dim RowNo As Integer
Dim adnewrow As DataRow = DTCodeMaster.NewRow()
RowNo = DTCodeMaster.Rows.Count - 1
adnewrow("Acct_Code") = TxtAcctCode.Text
DACodeMaster.Update(DTCodeMaster) ' Errow on this line

What could be the issue?

Try this

adnewrow("Acct_Code") = TxtAcctCode.Text
DACodeMaster.UpdateCommand = CBCodeMaster.GetUpdateCommand()

giving below error

The DataAdapter.SelectCommand property needs to be initialized.

If i put the code from module to form its works. but i want the code in module because i will need this connection code several time in my project.