Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
object reference not set to an instance of object
narasiman rao
Sep 19 2015 1:09 AM
328
Reply
Add button code as follows
Sql = "select cpm_pkg_id from CO_PACKAGE_MASTER where cpm_pkg_name = '" + txtpkgdesc.Text.ToString().Trim() + "' ";
dt1 = SCon.ReadSql_DT(Sql);
if(dt1.Rows.Count>0)
{
Sql ="Insert into CO_PACKAGE_DETAIL values('" + dt1.Rows[0]["cpm_pkg_id"].ToString() + "','" + gvmajormaster.selectedrow(1].tostring.trim() + "','" + gvmajormaster.selectedrows[2].tostring().trim() + "')";
SCon.ExecSql(Sql);
lblErr.Text = "Package details inserted successfully";
}
In gridview as follows
Select Major Code Minor Code
PSTF AFF
i want to insert the above gridview row values PSTF (Major code) and AFF(Minor Code) into co_package detail.
i tried the below code but shows error as follows
Object reference not set to an instance of an object.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to Unable to cast COM object of type 'System.__ComObject
Receiving data from COM3 port gives error?