I have corrected my statement and this time I'm getting this error: "Object reference not set to an instance of an object." And the error source: Line 219: myCommand.CommandText="select * from dbo.DashBoard where Name Like @Billing"; Line 220: myCommand.Parameters.Add(new SqlParameter("@Billing",SqlDbType.VarChar,50)); Line 221: myCommand.Parameters["@Billing"].Value= bc.Text; Line 222: SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand); Line 223: DataSet ds = new DataSet(); This is my code: My code behind: private void dgoperation_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { System.Web.UI.WebControls.LinkButton bc=new System.Web.UI.WebControls.LinkButton(); bc=(System.Web.UI.WebControls.LinkButton)e.Item.Cells[0].FindControl("TeamBĀilling"); SqlCommand myCommand=new SqlCommand(); myCommand.Connection=con; myCommand.CommandText="select * from dbo.DashBoard where Name Like @Billing"; myCommand.Parameters.Add(new SqlParameter("@Billing",SqlDbType.VarChar, 50)); myCommand.Parameters["@Billing"].Value= bc.Text; SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand); DataSet ds = new DataSet(); myAdapter.Fill(ds); dgis.DataSource=ds; dgis.EditItemIndex = -1; dgis.DataBind(); } How can I solve this? Thanks