Details about the error you see:
NullReferenceException Class (System) | Microsoft Docs[
^]
Quote:
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null
Possibly because:
1. You've forgotten to instantiate a reference type
2. You've forgotten to dimension an array before initializing it.
3. You get a null return value from a method, and then call a method on the returned type.
4. You're using an expression (for example, you're chaining a list of methods or properties together) to retrieve a value
5. You're enumerating the elements of an array that contains reference types, and your attempt to process one of the elements throws
6. Exception is thrown by a method that is passed null
Following will help you learn about debugging:
Tutorial: Debug Visual Basic code - Visual Studio | Microsoft Docs[
^]
First look at the debugger - Visual Studio | Microsoft Docs[
^]
When you debug, you will be able to get the exact line where the variable is NULL and error is being raised.
For you I am suspecting error from below portion of code:
TextBox TextBox1 = (TextBox)row.FindControl("SrNO");
TextBox TextBox2 = (TextBox)row.FindControl("productname");
TextBox TextBox3 = (TextBox)row.FindControl("Quntity");
TextBox TextBox4 = (TextBox)row.FindControl("Rate");
TextBox TextBox5 = (TextBox)row.FindControl("Total");
If any one findcontrol fails (because of incorrect case of name or so), followup code expecting the textbox as valid control will bomb while using .Text property. Though, given you seem new and have not shared either error stack trace or entire code, error could be coming from elsewhere.
Try out.