10
Reply

Insert Records into database

Becky Bloomwood

Becky Bloomwood

Feb 6 2011 3:27 AM
1.7k
Hi all,
currently I am doing an online store project using an example from one of your tutorials. In the grid view is populated with data and at the below of the grid view, there is a row of empty fields populated below. After user have enter all the necessary info and clicks on the Add New link, the data will be inserted into the database and it will also be displayed in the grid view itself.

The software that I am using is called: MS VS 2008 C#
The database that I am using is called: MS SQL Server 2008

The attachment contains the database.cs, stored procedure and business logic. When I debug there is an error indicating:Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

This sentence is highlighted in red-osdb.Insert_ItemsRecords(txtID.Text, txtItemName.Text, txtItemDesc.Text);
 BindGrid(true);
 
Thanks



Attachment: Insert.zip

Answers (10)