Using Visual Studio 2010 for Sharepoint 2010 development - visual-studio-2010

I am a newbie to SharePoint 2010 development, even though am a .net developer for past 3 years. I have setup development env with windows 7(64-bit), sharepoint foundation 2010, visual studio 2010, and sql server 2001 R2 in a virtual machine. As a beginning, I created a new web application in SharePoint 2010 and also created new site collection. Then I created a custom list for student details. Now I need to create a simple student registration page which validate all the user entries for example email id, phone number etc using regular expression and few fields using required field validator. I need to how can I use Visual Studio 2010 for this purpose. Please consider this as an entry level question in SharePoint 2010 development. Hope this question fits right in this forum.

Start the Visual studio
File Menu-> New -> Project -> Select SharePoint From installed Template -> Empty SharePoint Project
Give proper name and save it
then it ask for SharePoint URL
enter SharePoint URL and validate it then press Finish button
Now your solution is ready to use
in solution explorer select project right click on it
Add new Item -> Visual web part
you have to write your code in User control on this web part some code snippet is as follow:
using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb web = site.OpenWeb())
{
SPList StudentInfoList = web.Lists["Student Information"];
SPListItemCollection listItems = StudentInfoList.GetItems();
SPListItem item = listItems.Add();
item["RollNumber"] = Convert.ToInt32(TextBox1.Text);;
item["StudentName"] = TextBox2.Text
item["PhoneNumber"] = TextBox3.Text;
item["EmailID"] = TextBox4.Text;
item.Update();
StudentInfoList.Update();
}
}
Welcome to SharePoint :-)

Related

TFS Object Model 2017 TeamProjectPicker not working with VSTS

I've been using TeamProjectPicker with different version of TFS Object Model, but since Visual Studio/Team Explorer 2017. It's not working with VSTS specially when using Azure Active Directory account to connect with VSTS. For on-prem TFS with on-prem active directory accounts it works fine.
If I would use TFS Object Model 2015 it works fine and connect to VSTS without any problem. I'm working on a product/application which picks the installed version of Visual Studio and uses the Object Model of the same VS/TE by using dependency injection. Means if I install my application on machine having Visual Studio/Team Explorer 2015, my application will start using TFS Object Model 2015.
var tfsPp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
DialogResult dialogResult = tfsPp.ShowDialog();
If there's limitation of TeamProjectPicker (TFS OM 2017) with VSTS, I'm ready to change the dialog window. I've been looking VS Services Client Lbrary but could find any dialog window. If I can have connection dialog window that's shown in Team Explorer that would be acceptable.
Seems it's permission issue, just as Mike mentioned you may need some impersonation here.
Based on the error messages you can refer below articles to troubleshoot them:
TF31003: Your user account does not have permission to connect to
the Team Foundation Server {0}
How To Fix TF30063 Error - You Are Not Authorized To Access Team
Foundation Service Error
TFS API Part 29 – TFS Impersonation
UPDATE:
Just try to install the Nuget Package Microsoft.TeamFoundationServer.ExtendedClient for your project.
I tested on my side, everything works as expected with the VS 2017 installed only.

Sharepoint list workflow in Visual Studio

I'm trying to create a Sharepoint Workflow (for SharePoint Online) in Visual Studio 2015 (Pro).
The workflow is for a specific document Library. But Visual Studio doesn't show me the available lists when trying to create the new workflow items.
Steps: new item... - Workflow
I select List Workflow, and then I can "Associate this workflow with the following lbiraries and lists".
Here is where it goes wrong, because the listboxes are empty.
Is there a property that I have to configure or a special link I have to make somewhere?
seems impossible to leverage VS to create workflow for sharepoint online.
https://social.technet.microsoft.com/Forums/ie/en-US/989e3874-3756-4c33-bdb0-89a14a093c1c/visual-studio-2013-workflow-on-sharepoint-online-site-target-list-and-deployment-questions?forum=onlineservicessharepoint

Word Task Pane Apps - SharePoint Connection

I want to input data from a SharePoint list into a Word document using a Task Pane App. I am creating the app in Visual Studio. When I click on Tools/Add SharePoint connection, but I get a message that says that I don't have SharePoint Foundation installed on my system. I have Visual Studio on my computer and my SharePoint site is in the cloud, so I don't see how SharePoint Foundation would be on my system in this context.
Any suggestions as to how to connect to the list or where to go for instructions would be appreciated.
you can create sharepoint hosted app, please refer these link :
https://blogs.msdn.microsoft.com/nickpinheiro/2015/01/30/build-a-sharepoint-hosted-app-to-access-list-data-in-your-host-web-using-the-rest-api-in-10-easy-steps/
Also refer these for working with sharepoint list data:
https://blogs.technet.microsoft.com/fromthefield/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript/

Where is this "Business Value - Microsoft Visual Studio Scrum 1_0" field name coming from?

When I create a new Team Project in TFS 2013 from within VS 2013 off of the "Microsoft Visual Studio Scrum 2013" (default) process template, I get a field named:
Business Value - Microsoft Visual Studio Scrum 1_0
In the Product Backlog Item work item type.
If a different user creates a team project (on the same server, using same VS version), it is simply named:
Business Value
Weird..
The problem with this is that I want to import my work item type, which I have customized by adding new custom fields, into another team project, however I get
error importing work item type defintion:
TF26177: The field Microsoft>VSTS.Common.BusinessValue cannot be renamed from 'Business Value - Microsoft Visual Studio Scrum 1_0' to 'Business Value'.
I am afraid to simply rename this out-of-the-box field name in my WIT - I don't trust this would be okay when it comes time to upgrade TFS again..
Any idea where this "Business Value - Microsoft Visual Studio Scrum 1_0" field name is coming from? I don't see this string anywhere in the "Microsoft Visual Studio Scrum 2013" Process Template files when I export/download it from Process Template Manager.

TFS 2010- Sharepoint 2010 Project Portal

I have TFS 2010 integrated with share-point 2010, inside the project portal i try to add a new task but there is no start date neither due date ?
is that normal ? how can i add these fields ?
It is normal I'm afraid, the web page view of a Work Item is usually identical to the view of the same item in Visual Studio. For some reason these fields are hidden.
You have 2 options. You can change the Work Item template on your Team Project so that these fields are not hidden, or you can use the Office integration features of Team Explorer.
To edit the template you'll need the TFS 2010 power tools.
To use Office integration you'll need Team Explorer installed, plus either Excel 2007+ or MS Project 2007+. Project automaticaly hooks in to the start and due date, with excel you can select which fields you want to view and sync with TFS

Resources