This sample shows different uses of Join Operators
This sample shows a simple ADO.NET Data Service exposing data through the ADO.NET Entity Framework and a WPF application consuming the ADO.NET Data Service.
This sample shows different uses of Grouping Operators
This sample shows a WPF application built on top of the Microsoft ADO.NET Entity Framework. The application shows how the Entity Framework can be used in some common design patterns that promote testability and maintainability of code.
This sample shows different uses of Restriction Operators.
This project contains about 101 samples using LINQ.
This sample shows different uses of Projection Operators
This sample shows different uses of Aggregate Operators
This sample shows different uses of Ordering Operators
This sample shows different uses of Set Operators.
This sample shows different uses of Query Execution
This sample shows different uses of Partitioning Operators
This sample shows different uses of Element Operators
Another simple LINQ to XML sample query. This sample shows the minimal code necessary to write a LINQ to XML query.
This sample shows different uses of Quantifiers
This sample shows different uses of Conversion Operators
This sample demonstrates the following threading techniques. See Threading (C# Programming Guide) for more information.
Creating, launching, and terminating a thread
Using a thread pool
Thread synchronization and interaction
This sample code is provided to illustrate a concept an
This sample shows how to declare, invoke, and configure events in C#. For additional information, see Events (C# Programming Guide).
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest codin
This sample shows different uses of Miscellaneous Operators
This sample acts as a tiny web server that aggregates several RSS feeds.
This sample shows different uses of Custom Sequence Operators
This sample demonstrates the following concepts:
Binding the following content controls to database fields:
PlainTextContentControl
PictureContentControl
DatePickerContentControl
Saving data in a data-bound content control to the database (this is also named two-way data binding)
This sample demonstrates how to use a Microsoft Access database from C#. It shows how you can create a dataset and add tables to it from a database. The BugTypes.mdb database used in the sample program is a Microsoft Access 2000 .mdb file.
This sample code is provided to illustra
This sample demonstrates how to:
Retrieve and use data from an XML file that was extracted from a SQL Server database.
Display the data using data-bound Excel controls.
Work with multiple sets of master/detail data.
This sample demonstrates how to modify security permissions through
permission classes and permission attributes. For additional information, see Security
(C# Programming Guide).
Security
Note
This sample code is provided to illustrate a concept and should not be
used in
This sample shows how to create and use a DLL in C#.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential dama
The sample demonstrates the following tasks:
Reading data from XML files.
Customizing menus and toolbars.
Using Excel built-in functions to analyze data.
Creating pivot tables that are linked to data in XML files.
Binding XML data to Excel list controls.
Creating charts.
Preparin
This sample shows different uses of Generation Operators
This sample demonstrates the delegate types. It shows how to map delegates to static and instance methods, and how to combine them to create multicast delegates.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may no
These samples demonstrate various ways of working with XML data.
These samples show how to load an XML document and run queries against it.
This sample demonstrates how a C# program can interoperate with an unmanaged COM component.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liabili
Several examples of how to write and use lambda expressions.
This sample shows how to use XML to document code. See XML Documentation Comments (C# Programming Guide) for additional information.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest codin
This sample demonstrates the following concepts:
Creating a Ribbon customization by implementing the Microsoft.Office.Core.IRibbonExtensibility interface in an add-in.
Creating a custom task pane by implementing the Microsoft.Office.Core.ICustomTaskPaneConsumer interface in an ad
This sample shows how to create a custom generic list class with a single type parameter, and how to implement IEnumerable<T> to enable foreach iteration over the contents of the list. The sample also shows how client code creates an instance of the class by specifying a ty
This sample demonstrates how to call platform invokes (exported DLL functions) from C#. See Interoperability (C# Programming Guide) for more information.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illust
Use LINQ to right queries against the objects in your code using the Reflection APIs.
This sample shows how properties are an integral part of the C# programming language. It demonstrates how properties are declared and used. See Properties (C# Programming Guide) for more information.
This sample code is provided to illustrate a concept and should not be used in a
This sample shows how to use the C# 4.0 features called COM Interop,
omitting ref, indexed properties and Named and Optional Parameters to create a C#
application that communicates with Microsoft Office. C# developers have traditionally had
to write relatively verbose code i
This sample demonstrates the following concepts:
Creating a Ribbon customization by implementing the Microsoft.Office.Core.IRibbonExtensibility interface in an add-in.
Creating a custom task pane by implementing the Microsoft.Office.Core.ICustomTaskPaneConsumer interface in an ad
These samples demonstrate how to use XmlWriter to output XML data.
These samples demonstrate how to use various query operators on XML data, such as TakeWhile, Any, All, Distinct, Concat, and others.
These samples show how to integrate C# code with LINQ queries.
This sample shows how to implement a collection class that can be used with the foreach statement. See Collection Classes (C# Programming Guide) for more information.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it m
These samples show how to construct XML elements and documents from code using LINQ to XML.
These samples show how to attach event listeners to XML elements.
This sample will start a workflow once a document is uploaded to the Shared Documents Library. The workflow will make an entry in the task list. The workflow is completed once the user sets the task as 100% complete.To run the sample - Change the Site URL property of the project
This sample of a Visual WebPart demonstrates how to list all of the site collections on the local SharePoint server. For the selected site collection it displays statistical data for each list within the site collection.To run the sample - Change the Site URL property of th
This example shows how to integrate Visual C# 2010 and IronPython using the new 'dynamic' feature added in C# 4.0
To run the sample, you will need to install IronPython 2.6.1,
which is a available as a separate download. It may also work with more recent versions of IronPytho
This sample demonstrates conditional methods, which provide a powerful mechanism by which calls to methods can be included or omitted depending on whether a symbol is defined.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites
How to re-create a control after a user deletes it.
How to write data to a data-bound ListObject control on a protected worksheet.
How to write data to a NamedRange control on a protected worksheet.
How to protect a value in a NamedRange control from unauthorized modification
These samples demonstrate using XNamespace in LINQ to XML to work with XML Namespaces.
This sample shows different uses of Ordering Operators
This sample shows how C# classes can declare indexers to provide array-like access to the classes.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no
These samples show how to use Data Manipulation Language (DML) using LINQ to XML.
This sample shows several versions of a Hello World program in C#.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or cons
This sample shows how to define conversions to or from classes or structures, and how such conversions are used. See Conversion Operators (C# Programming Guide) for more information.
This sample code is provided to illustrate a concept and should not be used in applications or We
This sample demonstrates how to explicitly implement interface members and how to access those members from interface instances. For background information, see Interfaces (C# Programming Guide).
This sample code is provided to illustrate a concept and should not be used in appli
This sample demonstrates how to use unmanaged code (code using pointers) in C#.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incid
This sample shows different uses of Linq Over Typed DataSet
This sample demonstrates the following concepts:
Creating separate and adjoining form regions.
Using managed controls in a form region.
Accessing an instance of the Microsoft.Office.Interop.Outlook.PostItem class.
This sample demonstrates versioning in C# through the use of the override and new keywords. Versioning helps maintain compatibility between base and derived classes as they evolve. For additional information, see Versioning with the Override and New Keywords (C# Programming Guide
The SimpleVariance sample program shows C# 4.0 support for
covariance and contravariance when using generic types in delegates and
interfaces. In C# 3.0 generic types were invariant. As a result, this sample compiles fine in C# 4.0, while it
does not compile in previous ver
This sample demonstrates using a C# server with a C++ COM client.
You must have administrator rights to run this program and Visual C++ must be installed to compile this sample.
This sample code is provided to illustrate a concept and should not be used in applications or Web
C# 4.0 supports named and optional parameters. This program demonstrates how to
declare a method with named and optional parameters, and how to call the method
while making use of the default values for the parameters, and by explicit
nam
These samples demonstrate how to sort results using "orderby" in LINQ to XML.
This sample demonstrates how user-defined classes can overload operators. See C# Operators for more information.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microso
These samples demonstrate how to work with XmlReaderSettings and DtdProcessing to output an SGML document.
This sample shows how to create a list class which implements IEnumerable<int> and the yield keyword to enable foreach iteration over the contents of the list. Two properties are defined, one returning the odd numbers, the other returning the even numbers.
This sample code
This sample shows how the command line can be accessed and two ways of accessing the array of command-line parameters.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. M
These samples show how to transform XML data into HTML code.
These samples show how to group results in a LINQ to XML query.
This sample demonstrates the use of partial types, which enable a class or struct to be defined in two or more C# files. This allows multiple programmers to work on different portions of a class in parallel, and for different facets of a complex class to be kept in separate files
This sample demonstrates the use of nullable types. This feature allows value types to have an uninitialized, or empty, state similar to how reference types can be set to null.
Security Note This sample code is provided to illustrate a concept and should not be used in applicat
This sample demonstrates how to create custom attribute classes, use them in code, and query them through reflection. For additional information on attributes, see Attributes (C# Programming Guide).
This sample code is provided to illustrate a concept and should not be used in ap
These samples demonstrate how to retrieve a sequence of data based on certain criteria.
Apply to both VB and C# sample projects.These BDC samples connect to Northwind database as external data source. Please read below notes carefully and make sure you have the Northwind database connection before you run the sample project.Prepare Northwind DBIf you already have a
This is a sample of a Visual Studio 2010 extension for use with the new SharePoint project templates. It takes advantage of the extensibility APIs that are part of the new SharePoint development tools within Visual Studio 2010. The extension is for a SharePoint custom
This sample presents the syntax and usage of structs. It also covers the important differences between classes and structs. See Objects, Classes and Structs (C# Programming Guide) for more information.
This sample code is provided to illustrate a concept and should not be used in
These samples demonstrate some ways to use LINQ to XML to join, filter, order, search, etc.
This sample shows different uses of Generation Operators
This sample shows how C# classes can declare indexers to represent an array-like collection of different kinds of things. See Properties (C# Programming Guide) for additional information.
This sample code is provided to illustrate a concept and should not be used in applications
These samples demonstrate how to output data into a new XML file structure while preserving the overall data and hierarchy.
This sample creates a new SharePoint List(DonationList) and ListInstance(DonationInstance) with an EventReceiver(DonationDeleting) attached. To run the sample - Change the Site URL property of the project to a valid SharePoint site on your development system (i.e. http://<Mac
To enable this sample to run on Microsoft Office SharePoint Server (MOSS) 2007 you must make the following changes to the workflow project: - Change the Debugging Site URL property to "http://localhost/Docs/", or another valid SharePoint site on your development system.
This sample shows different DataSet Loading Examples