protected void btnSave_Click(object sender, EventArgs e) { TextBox txtProductId = DetailsView1.FindControl("txtProductID") as TextBox; TextBox txtProductName = DetailsView1.FindControl("txtProductName") as TextBox; TextBox txtProductDesc = DetailsView1.FindControl("txtProductDesc") as TextBox; TextBox txtProductVersion = DetailsView1.FindControl("txtProductVersion") as TextBox; TextBox txtProductType = DetailsView1.FindControl("txtProductType") as TextBox; TextBox txtProductCategory = DetailsView1.FindControl("txtProductCategory") as TextBox; TextBox txtProductRating = DetailsView1.FindControl("txtProductRating") as TextBox; TextBox txtProductUserID = DetailsView1.FindControl("txtProductUserID") as TextBox; TextBox txtProductPassword = DetailsView1.FindControl("txtProductPassword") as TextBox; TextBox txtProductPOC = DetailsView1.FindControl("txtProductPOC") as TextBox; TextBox txtProductEmail = DetailsView1.FindControl("txtProductEmail") as TextBox; TextBox txtProductComment = DetailsView1.FindControl("txtProductComment") as TextBox; int ProductID = Convert.ToInt32(txtProductId.Text.ToString()); string ProductName = txtProductName.Text.ToString(); string ProductDesc = txtProductDesc.Text.ToString(); string ProductVersion = txtProductVersion.Text.ToString(); string ProductType = txtProductType.Text.ToString(); string ProductCategory = txtProductCategory.Text.ToString(); string ProductRating = txtProductRating.Text.ToString(); string ProductUserID = txtProductUserID.Text.ToString(); string ProductPassword = txtProductPassword.Text.ToString(); string ProductPOC = txtProductPOC.Text.ToString(); string ProductEmail = txtProductEmail.Text.ToString(); string ProductComment = txtProductComment.Text.ToString(); Debug.WriteLine(""); Debug.WriteLine("Data From Grid:"); Debug.WriteLine("ProductID: " + ProductID); Debug.WriteLine("ProductName: " + ProductName); Debug.WriteLine("ProductDesc: " + ProductDesc); Debug.WriteLine("ProductVersion: " + ProductVersion); Debug.WriteLine("ProductType: " + ProductType); Debug.WriteLine("ProductCategory: " + ProductCategory); Debug.WriteLine("ProductRating: " + ProductRating); Debug.WriteLine("ProductUserID: " + ProductUserID); Debug.WriteLine("ProductPassword: "******"ProductPOC: " + ProductPOC); Debug.WriteLine("ProductEmail: " + ProductEmail); Debug.WriteLine("ProductComment: " + ProductComment); DatabaseConnectivity dbcon = new DatabaseConnectivity(); int ResultQuery = dbcon.setAProduct(ProductID, ProductName, ProductDesc, ProductVersion, ProductType, ProductCategory, ProductRating, ProductUserID, ProductPassword, ProductPOC, ProductEmail, ProductComment); DetailsView1.Visible = false; }