I'm sure I'm just tired and will feel really stupid when I find out the answer, but I have a Web Page that when it tries to set Insert Parameters gives me a NullReferenceException (see subject)
The specific method is :
protected void frmChgRequest_Inserting(object sender, FormViewInsertEventArgs e) {
SqlChgRequest.InsertParameters["ChgID"].DefaultValue = chgIDComplete.ToString();
SqlChgRequest.InsertParameters["RequestDate"].DefaultValue = DateTime.Now.ToString();
}
The error occurs on the first InsertParameters statement. The obvious answer is that the stringbuilder "chgIDComplete" is null, but on debug, it shows a value of "MERCHANT2008115HW". A stringbuilder should have no problem converting to a string. What am I doing wrong?

Guest UserRank #1,422 · 1.2K reputationPosted Jan 16, 2008, 3:56 PM EST
Anna Hawks102 reputationPosted Jan 17, 2008, 4:19 AM EST
Guest UserRank #1,422 · 1.2K reputationPosted Jan 17, 2008, 5:42 AM EST
Guest UserRank #1,422 · 1.2K reputationPosted Jan 17, 2008, 5:53 AM EST
http://www.aspfree.com/c/a/ASP.NET/Programmatically-Updating-Databases-using-ASPNET-20-SqlDataSource/2/
Anna Hawks102 reputationPosted Jan 17, 2008, 6:35 AM EST
I've solved the problem. Don't know how offhand, but it's fixed.
Thanks for all the input!