vb.net - datagrids inserting records



I have a datagrid that I need to insert records into but I want my users to
only enter data into one field and I want to fill the rest of the new
information from parameter fields.

When my code checks for "HasChanges" I set the parameter values for the
empty fields and when the code gets to the "SqlDataAdapter1.Update" I get a
message that my key field does not allow nulls (one of my parameter fields).
The message box title line said "Error when committing the to the original
data store".

What am I missing?
I'm using the parameters defined in the Windows generated code to set the
key field and remaining data fields.
See code same below.

Thanks……

If DsUpdateDetailInfo1.HasChanges Then

SqlInsertCommand1.Parameters("@PermitId").Value = MyPermitNo
SqlInsertCommand1.Parameters("@UpdateDt").Value = DateTime.Now
SqlInsertCommand1.Parameters("@UpdateUserId").Value = "Me123"

SqlUpdateCommand1.Parameters("@PermitId").Value = MyPermitNo
SqlUpdateCommand1.Parameters("@UpdateDt").Value = DateTime.Now
SqlUpdateCommand1.Parameters("@UpdateUserId").Value = "Me123"

SqlDataAdapter1.Update(DsUpdateDetailInfo1)
.