Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

object error

I am using a view from a different database to populate my datagrid. Once the user hits import button inside the datagrid the record is removed from view. the screen goes through the motions but doesn't remove the record from view and it gives me this error: Object reference not set to an instance of an object.
private void gridImport_ItemCommand(object source, DataGridCommandEventArgs e)
		{
			if(e.CommandName == "import")
			{			
				string proposal_number=e.CommandArgument.ToString();				
				
				TransferProposalPackage(proposal_number + ".pdf");
				ADTransfer.Transfer transfer = new ADTransfer.Transfer(proposal_number,Cycle.ColumnValue.pk_cycle.ToString());
				lblErrMsg.Text=transfer.errMessage;
				bindDataGrid();
 
						
			}			
 
		}

Open in new window

0
MoniMatthews
Asked:
MoniMatthews
1 Solution
 
ororioleCommented:
Set a breakpoint at the beginning of the event handler. Its short so you can single step thru it. One of the objects is null. Check their values and see which one it is.
0
 
MoniMatthewsAuthor Commented:
Thank you for your help.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now