Deploy a custom web part to SharePoint 2010 site:
First open visual studio and create an empty SharePoint project.
Give correct SharePoint site path when asked and you can create a project at farm level or sandbox solution both based on your privileges.
Once you complete these steps then from solution explorer add new item and add a new web part. Give a name to your web part.
Now copy this code:
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Label lbl = new Label();
lbl.ID = "lblTime";
lbl.Text = DateTime.Now.ToString();
Now build your application.
Now from solution explorer right click on project name and select deploy.
Once your deployment process will succeed then your respective SharePoint site will open in a new browser window.
Now from Site Action select Edit Page.
Then on the page click on 'Add a web part'.
From the category select 'Custom' and then select your web part name from the group.
And click on 'Add'.
Your web-part will be added to your page.
it is help full to me thanks