sprite2D is of type UnityEngine.Sprite, yet you are trying to assign it by text.
You have two options: either pass a UnityEngine.Sprite instead, or change your UI2DSprite to be UISprite instead, using NGUI's atlases. Going with NGUI's atlases you will be able to assign sprites by name.