---
title: "not able to store data in database"  
description: "not able to store data in database"  
author: "ashwini dharamsale"  
published: 2014-01-21  
updated: 2014-01-21  
canonical: https://www.mindstick.com/forum/1852/not-able-to-store-data-in-database  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# not able to store data in database

protected void InsertNewRecord(object sender, EventArgs e)\
{\
\
try\
{\
[string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) strName = GlobalClass.dt.Rows[0]["TechnisionName"].ToString();\
if (strName == "0")\
{\
GlobalClass.dt.Rows[0].Delete();\
GlobalClass.adap.Update(GlobalClass.dt);\
}\
[TextBox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) txtDate = GridView1.FooterRow.FindControl("txtNewDate") as TextBox;\
TextBox txtName = GridView1.FooterRow.FindControl("txtNewName") as TextBox;\
TextBox txtTask = GridView1.FooterRow.FindControl("txtNewTask") as TextBox;\
TextBox txtStatus = GridView1.FooterRow.FindControl("txtNewStatus") as TextBox;\
TextBox txtRemark = GridView1.FooterRow.FindControl("txtNewRemark") as TextBox;\
DataRow dr = GlobalClass.dt.NewRow();\
dr["[Date](https://yourviews.mindstick.com/story/3869/propose-day-2024-exciting-date-ideas-for-you-and-your-partner)"] = txtDate.Text.Trim();\
dr["TechnisionName"] = txtName.Text.Trim();\
dr["[Task](https://www.mindstick.com/forum/161761/what-is-the-difference-between-task-and-thread)"] = txtTask.Text.Trim();\
dr["[Status](https://www.mindstick.com/articles/157184/check-lic-policy-status-online-by-policy-number)"] = txtStatus.Text.Trim();\
dr["Remark"] = txtRemark.Text.Trim();\
GlobalClass.dt.Rows.Add(dr);\
GlobalClass.adap.Update(GlobalClass.dt);\
GridView1.ShowFooter = false;\
FillGridView();\
}\
[catch](https://www.mindstick.com/forum/159341/how-to-use-try-and-catch-in-java-for-exception-handling-and-what-happens-when-an-exception-occurs)\
{\
[Response.Write](https://www.mindstick.com/forum/1031/response-write-doesn-t-display-image)("<[script](https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line)> [alert](https://answers.mindstick.com/qa/30927/what-is-an-alert)('Record not added...') </script>");\
}\
}


---

Original Source: https://www.mindstick.com/forum/1852/not-able-to-store-data-in-database

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
