title: The parameterized query '(@Date date,@DocNo nvarchar(2),@CostCenter nvarchar(11),@Transac' expects the parameter '@AccountID', which was not supplied
body: <p>I am stuck in strange situation. i have one form containing 1 DateTimePicker 2 Textboxes, 1 Combobox and one datagridview.
  I have set the coding using VB.Net which save the data in one row of SQL Database from Textboxes DTPickers, Combobox and all rows of Datagridview simultaneously. the data saved successfully But i am getting this error messege despite AccountID is not null. Before suggesting DBNull.Value, i want to clarify here that if i use this option it saves one extra row in the database taking existing values from DTpicker, Textboxes and Comboboxes. Please help me to solve this issue.</p>
  <pre><code>con.Open()
      For Each row As DataGridViewRow In DataGridView1.Rows
          cmd = New SqlCommand(&quot;Insert into Transs (Date,DocNo,CostCenter,TransactionID,AccountID,AccountName,AccountType,Debit,Credit,Text) values (@Date,@DocNo,@CostCenter,@TransactionID,@AccountID,@AccountName,@AccountType,@Debit,@Credit,@Text)&quot;, con)
  
      cmd.Parameters.Add(&quot;@Date&quot;, SqlDbType.Date).Value = DateTimePicker1.Value
      cmd.Parameters.AddWithValue(&quot;@DocNo&quot;, TextBox1.Text)
      cmd.Parameters.AddWithValue(&quot;@CostCenter&quot;, ComboBox1.SelectedItem)
      cmd.Parameters.AddWithValue(&quot;@TransactionID&quot;, TextBox2.Text)
      cmd.Parameters.AddWithValue(&quot;@AccountID&quot;, row.Cells(&quot;Column1&quot;).Value)
      cmd.Parameters.AddWithValue(&quot;@AccountName&quot;, row.Cells(&quot;Column2&quot;).Value)
      cmd.Parameters.AddWithValue(&quot;@AccountType&quot;, row.Cells(&quot;Column3&quot;).Value)
      cmd.Parameters.AddWithValue(&quot;@Debit&quot;, row.Cells(&quot;Column4&quot;).Value)
      cmd.Parameters.AddWithValue(&quot;@Credit&quot;, row.Cells(&quot;Column5&quot;).Value)
      cmd.Parameters.AddWithValue(&quot;@Text&quot;, row.Cells(&quot;Column6&quot;).Value)
      Try
          cmd.ExecuteNonQuery()
  
      Catch ex As Exception
          MessageBox.Show(ex.Message)
      End Try
  Next
  con.Close()
  MsgBox(&quot;Record saved successfully!&quot;)
  </code></pre>