In your snippet, adsJarvis.InsertParameters["spaceObjectName"]
is of course null because the compiler is looking for paramater named spaceObjectName
, that's why it throws a NullReferenceException. You need to reference that in your aspx page.
Try this:
<asp:AccessDataSource ID="adsJarvis" runat="server" DataFile="~/App_Code/adbJarvisStars.accdb"
SelectCommand="SELECT * FROM [spaceObjectTable]"
InsertCommand="INSERT INTO spaceObjectTable( spaceObjectName, RA, DEC) VALUES (?, ?, ?)">
<InsertParameters>
<asp:Parameter Name="spaceObjectName" Type="string" />
<asp:Parameter Name="RA" Type="string" />
<asp:Parameter Name="DEC" Type="string" />
</InsertParameters>
</asp:AccessDataSource>
so in your code behind you can:
adsJarvis.InsertParameters["spaceObjectName"].DefaultValue = ...;
....