bindingとは? わかりやすく解説

binding

別表記:バインディング

「binding」とは、縛ること・束ねるもの・製本などのことを意味する英語表現である。

「binding」の基本的な意味

「binding」は、縛ることや束ねるもの、製本装丁などといった意味を持つ表現である。動詞である「bind」の現在分詞形であり、名詞形容詞として使われる

「binding」の語源

「binding」の語源ゲルマン祖語で「縛る」を意味するbindanaであるとされている。

「binding」の発音・読み方

「binding」は「バインディング」と読む。発音記号米国英語で「ˈbaɪndiŋ」であり、音節は「bínding」である。

「binding」を含む英熟語・英語表現

「binding protein」とは


binding protein」とは、「結合タンパク質」のことである。結合タンパク質とは、決まった分子結合するタンパク質のことである。主に生物学化学使われることが多い。例えば、DNA結合タンパク質DNA特異的に結合するタンパク質であり、結合することによって、DNAの修復複製転写調節などに関与している。配列特異的に結合するタイプと、どのような配列であっても結合できるタイプがあり、それぞれ関与している反応異なる。このように、各結合タンパク質にはそれぞれ特徴があり、結合先もDNAだけではなくRNAタンパク質脂質金属など様々である。

「Non-binding」とは


「Non-binding」とは、「法的拘束力のない」という意味である。英語で契約書作成する時などに使われる用語であり、「Legally Non-Binding」と呼ばれることもある。逆に、「binding」や「Legally binding」は「法的に拘束する」という意味になる。契約とは基本的に契約した当事者同士意思が最も尊重されることが多くお互い意思基づいて合意したであれば契約法的拘束力発生するとされている国が多い。このことによる不当な契約の解除ペナルティ避けるために、あえて「Non-binding」の一文契約書に付け加えことがある

「legally binding」とは


legally binding」とは、「法的に拘束する」という意味の表現である。「binding」だけでも同じ意味の表現として扱われるが、正確に法的に拘束する」と表現したい時は、「legally binding」を使う。英語での契約書作成する際に見られる表現である。基本的に契約書記載され内容は、その契約書締結されることによって、法的拘束力を持つものになる。つまり、改めて「法的に拘束する」と宣言しなくとも、契約書締結されたのであれば、それは法的拘束力を持つと見なされる場合が多い。だが、一般的に予備的合意段階では法的拘束力がないとされることが多く、これに法的拘束力持たせたい場合に、「legally binding」と表記することによって、正式な契約を交わす前の予備的合意であっても法的拘束力を持つものにすることができる。

「be binding」とは


bindingはbind現在分詞形であるため、bindingにbe動詞合わせる進行形になり、「~しているところ」というように訳すことができる。「be binding」は、bindingの持つ意味と照らし合わせて、「拘束力」や「拘束力がある」と表現されることが多い。

「BINDing (ネコぱら) 1/4 スケール」とは

「BINDing (ネコぱら) 1/4 スケール」とは、フィギュアメーカーである「BINDing」から発売されている「ネコぱら」というゲームキャラクター の1/4 スケールフィギュアのことである。ネコぱらとは、NEKO WORKs制作した同人ゲームであり、擬人化したヒロイン達との恋愛アドベンチャーゲームであり、2020年にはアニメ化もされている。フルボイスで、アニメーションのようにキャラクターが動くのが特徴である。2014年から配信されており、配信当初から日本語だけではなく、英語と中国語にも対応している

「binding」の使い方・例文

「binding」を使った例文として、
Create a legally non-binding contract.(法的拘束力のない契約書作成する
・She bought a carpet with a gold thread binding.(彼女は金糸縁取りがしてある絨毯購入した
Single-stranded DNA-binding proteins are a type of DNA-binding protein.(一本鎖DNA結合タンパク質は、DNA結合タンパク質一種である)
There are many types of binding proteins.(結合タンパク質には多く種類がある)
などが挙げられる

バインディング【binding】

読み方:ばいんでぃんぐ

ラグビーで、スクラムラックモールなどで味方選手どうしががっちり組み合うこと。スクラム場合は、敵味方互いに組み合うこともいう。

スキースノーボードを靴に取り付けるための締め具ビンディング

コンピューター情報工学分野で、複数事柄どうしを結びつけたり対応づけたりすること。特定のコンピューターへのIPアドレス割り当てや、プログラミング言語における、APIライブラリー関数との対応づけのほか、アプリケーションソフトキー操作機能結びつけること(キーバインディング)など。


Binding イベント


Binding クラス

名前空間: Microsoft.JScript
アセンブリ: Microsoft.JScript (microsoft.jscript.dll 内)
構文構文

Public MustInherit Class
 Binding
    Inherits AST
public abstract class Binding extends AST
public abstract class Binding extends
 AST
継承階層継承階層
System.Object
   Microsoft.JScript.AST
    Microsoft.JScript.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding クラス

XML Web サービス使用される具象データ形式およびプロトコル指定します。このクラス継承できません。

名前空間: System.Web.Services.Description
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public NotInheritable Class
 Binding
    Inherits NamedItem
public sealed class Binding : NamedItem
public ref class Binding sealed : public
 NamedItem
public final class Binding extends NamedItem
public final class Binding extends
 NamedItem
解説解説
使用例使用例

Binding クラス一般的な使用例を次に示します

' Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings("MathServiceHttpGet")
If Not (myBinding Is Nothing)
 Then
   Console.WriteLine((ControlChars.Cr + ControlChars.Cr + "Name
 : " + myBinding.Name))
   Console.WriteLine(("Type : " + myBinding.Type.ToString()))
End If
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings["MathServiceHttpGet"];
if (myBinding != null)
{
   Console.WriteLine("\n\nName : " + myBinding.Name);
   Console.WriteLine("Type : " + myBinding.Type);
}
// Get Binding Name = S"MathServiceSoap".
myBinding = myServiceDescription->Bindings[ "MathServiceHttpGet" ];
if ( myBinding != nullptr )
{
   Console::WriteLine( "\n\nName : {0}", myBinding->Name );
   Console::WriteLine( "Type : {0}", myBinding->Type );
}
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.get_Bindings().
    get_Item("MathServiceHttpGet");
if (myBinding != null) {
    Console.WriteLine("\n\nName : " + myBinding.get_Name());
    Console.WriteLine("Type : " + myBinding.get_Type());
}
継承階層継承階層
System.Object
   System.Web.Services.Description.DocumentableItem
     System.Web.Services.Description.NamedItem
      System.Web.Services.Description.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding メンバ
System.Web.Services.Description 名前空間

Binding クラス

オブジェクトプロパティ値とコントロールプロパティ値との間の単純バインディング表します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説

Binding クラス使用してオブジェクトプロパティまたはオブジェクトリスト内にある現在のオブジェクトプロパティいずれかと、コントロールプロパティとの間に、単純バインディング作成して維持します。

前者の例として、Customer オブジェクトFirstName プロパティに、TextBox コントロールText プロパティバインドできます後者の例として、顧客データ格納している DataTable の FirstName プロパティに、TextBox コントロールText プロパティバインドできます

また、Binding クラス使用すると、Format イベント通じて表示する値の書式設定したり、書式設定された値を Parse イベント通じて取得したりすることもできます

Binding コンストラクタBindingインスタンス作成する場合は、次の 3 つの項目指定する必要があります

まず、データバインド先とするコントロールプロパティ名を指定する必要があります。たとえば、TextBox コントロールデータ表示するには、Text プロパティ指定します

その後次の表に示すいずれかクラスインスタンスデータ ソースとして指定できます

説明

C# の例

IBindingList または ITypedList を実装する任意のクラス。これらのクラスには、DataSetDataTable、DataView、DataViewManager などがあります

DataSet ds = new DataSet("myDataSet");

IList を実装し、オブジェクトインデックス付きコレクション作成する任意のクラス。このコレクションは、Binding作成する前に作成され、その中にオブジェクト格納されていることが必要です。リスト内のオブジェクトの型は、すべて同じである必要がありますそれ以外場合は、例外スローさます。

ArrayList ar1 = new ArrayList;

Customer1 cust1 = new Customer("Louis");

ar1.Add(cust1);

厳密に指定されオブジェクトの、厳密に指定されIList

Customer [] custList = new Customer[3];

3 番目に、ナビゲーション パス指定する必要がありますナビゲーション パスには、空の文字列 ("")、単一プロパティ名、またはピリオド区切られた名前の階層指定できますナビゲーション パス空の文字列設定した場合は、基になるデータ ソース オブジェクトに対して ToString メソッド呼び出されます。

データ ソース複数の DataColumn オブジェクト格納できる DataTable場合は、ナビゲーション パス使用して特定の列に解決する必要があります

メモメモ

データ ソースDataSetDataViewManager、または DataTable場合実際にDataViewバインドされています。つまり、バインドされている行は、実際には DataRowView オブジェクトです。

複数DataTable オブジェクト格納するオブジェクト (DataSetDataViewManager など) がデータ ソースとして設定されている場合は、ピリオド区切りナビゲーション パスが必要です。他のオブジェクトへの参照返すプロパティを持つオブジェクト (他のクラス オブジェクト返すプロパティを持つクラスなど) にバインドする場合も、ピリオド区切りナビゲーション パス使用できます。たとえば、次のナビゲーション パスはすべて有効なデータ フィールド記述してます。

  • "Size.Height"

  • "Suppliers.CompanyName"

  • "Regions.regionsToCustomers.CustomerFirstName"

  • "Regions.regionsToCustomers.customersToOrders.ordersToDetails.Quantity"

パスの各メンバは、整数などの単一の値に解決されるプロパティ、または文字配列などの値のリスト返す場合ありますパスの各メンバリストまたはプロパティである可能性ありますが、最終メンバプロパティ解決されることが必要です。各メンバは、1 つ前のメンバ基づいてます。"Size.Height" は、現在の SizeHeight プロパティ解決されます。"Regions.regionsToCustomers.CustomerFirstName" は、現在の領域顧客1 人である顧客の名前に解決されます。

DataRelation は、DataSet 内で 1 つDataTable次の DataTableリンクすることによって値のリスト返しますDataSetDataRelation オブジェクト格納されている場合は、データ メンバとして、TableName の後に RelationName、さらに ColumnName を続けて指定できます。たとえば、"Suppliers" という名前の DataTable が "suppliers2products" という名前の DataRelation格納している場合データ メンバは "Suppliers.suppliers2products.ProductName" となります

データ ソースは、関連する一連のクラス構成されます。たとえば、太陽系形成する一連のクラス想定します。System という名前のクラスは、Star オブジェクトコレクション返す Stars という名前のプロパティ格納します。各 Star オブジェクトには、Name プロパティMass プロパティ、および Planet オブジェクトコレクション返す Planets プロパティあります。このシステムでは、各 planet にも Mass プロパティおよび Name プロパティあります。さらに、各 Planet オブジェクトには、Moon オブジェクトコレクション返す Moons プロパティがあり、各 Moon オブジェクトにも Name プロパティおよび Mass プロパティありますデータ ソースとして System オブジェクト指定する場合は、データ メンバとして次のいずれか指定できます

  • "Stars.Name"

  • "Stars.Mass"

  • "Stars.Planets.Name"

  • "Stars.Planets.Mass"

  • "Stars.Planets.Moons.Name"

  • "Stars.Planets.Moons.Mass"

単純バインドできるコントロールには、ControlBindingsCollection に格納される Binding オブジェクトコレクション関連付けられています。このコレクションには、そのコントロールの DataBindings プロパティ通じてアクセスできます。このコレクションBinding追加するには、Add メソッド呼び出します。これにより、コントロールプロパティオブジェクトプロパティ、またはリスト内の現在のオブジェクトプロパティバインドされます

たとえば、次の Windows コントロールなど、System.Windows.Forms.Control クラスから派生した任意のオブジェクトに単純バインドできます

メモメモ

ComboBoxCheckedListBoxListBox の各コントロールについては、SelectedValue プロパティだけが単純バインドされます

BindingManagerBase クラスは、特定のデータ ソースおよびデータ メンバBinding オブジェクトをすべて管理する抽象クラスです。CurrencyManager クラスおよび PropertyManager クラスは、BindingManagerBase から派生したクラスです。Bindingどのように管理されるかは、Bindingリスト バインディングまたはプロパティ バインディングのいずれであるかによって決まります。たとえば、リスト バインディング場合は、BindingManagerBase使用してリスト内の Position指定できます。その Position によって、リスト内の全項目のうち、コントロール実際にバインドされる項目が決まります適切な BindingManagerBase返すには、BindingContext を使用します

同じ DataSource にバインドされている一連のコントロール新しい行を追加するには、BindingManagerBase クラスの AddNew メソッド使用します適切な CurrencyManager返すには、BindingContext クラスItem プロパティ使用します新しい行の追加キャンセルするには、CancelCurrentEdit メソッド使用します

使用例使用例

単純データ バインディングを行うコントロールいくつか配置されている Windows フォーム作成例を次に示します。この例では、Customers および Orders という名前の 2 つテーブルを持つ DataSet と、custToOrders という名前の DataRelation作成します4 つコントロール (1 つDateTimePicker コントロール3 つの TextBox コントロール) は、テーブル内の列にデータ連結されています。この例は、各コントロールに対して Binding作成しそれぞれのコントロールDataBindings プロパティ通じて追加しますまた、フォームBindingContext通じて、各テーブルBindingManagerBase返します4 つButton コントロールが、BindingManagerBase オブジェクトPosition プロパティインクリメントまたはデクリメントます。

Imports System
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Globalization
Imports System.Windows.Forms

Public Class Form1
   Inherits Form

   Private components As Container
   Private button1 As Button
   Private button2 As Button
   Private button3 As Button
   Private button4 As Button
   Private text1 As TextBox
   Private text2 As TextBox
   Private text3 As TextBox

   Private bmCustomers As BindingManagerBase
   Private bmOrders As BindingManagerBase
   Private ds As DataSet
   Private DateTimePicker1 As DateTimePicker
   
   Public Sub New
      ' Required for Windows Form Designer support.
      InitializeComponent
      ' Call SetUp to bind the controls.
      SetUp
   End Sub

   Protected Overloads Overrides
 Sub Dispose(ByVal disposing As
 Boolean)
      If disposing Then
         If Not (components Is
 Nothing) Then
            components.Dispose()
         End If
      End If
      MyBase.Dispose(disposing)
    End Sub


   Private Sub InitializeComponent
      ' Create the form and its controls.
      With Me
         .components = New Container
         .button1 = New Button
         .button2 = New Button
         .button3 = New Button
         .button4 = New Button
         .text1 = New TextBox
         .text2 = New TextBox
         .text3 = New TextBox

         .DateTimePicker1 = New DateTimePicker
         
         .Text = "Binding Sample"
         .ClientSize = New Size(450, 200)

         With .button1
            .Location = New Point(24, 16)
            .Size = New Size(64, 24)
            .Text = "<"
            AddHandler button1.click, AddressOf
 button1_Click
         End With
         
         
         With .button2
            .Location = New Point(90, 16)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button2.click, AddressOf
 button2_Click
         End With
         
         With .button3
            .Location = New Point(90, 100)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button3.click, AddressOf
 button3_Click
         End With

         With .button4
            .Location = New Point(150, 100)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button4.click, AddressOf
 button4_Click
         End With

         With .text1
            .Location = New Point(24, 50)
            .Size = New Size(150, 24)
         End With

         With .text2
            .Location = New Point(190, 50)
            .Size = New Size(150, 24)
         End With

         With .text3
            .Location = New Point(290, 150)
            .Size = New Size(150, 24)
         End With

            With .DateTimePicker1
               .Location = New Point(90, 150)
               .Size = New Size(200, 800)
            End With

            With .Controls
            .Add(button1)
            .Add(button2)
            .Add(button3)
            .Add(button4)
            .Add(text1)
            .Add(text2)
            .Add(text3)
            .Add(DateTimePicker1)
            End With
      End With
   End Sub
      
   Public Shared Sub Main
      Application.Run(new Form1)
   End Sub

   Private Sub SetUp
      ' Create a DataSet with two tables and one relation.
      MakeDataSet
      BindControls
   End Sub

   Private Sub BindControls
      ' Create two Binding objects for the first two TextBox
      ' controls. The data-bound property for both controls
      ' is the Text property.  The data source is a DataSet
      ' (ds). The data member is the 
      ' TableName.ColumnName" string.

      text1.DataBindings.Add(New _
         Binding("Text", ds, "customers.custName"))
      text2.DataBindings.Add(New _
         Binding("Text", ds, "customers.custID"))
      ' Bind the DateTimePicker control by adding a new Binding.
      ' The data member of the DateTimePicker is a
      ' TableName.RelationName.ColumnName string
      DateTimePicker1.DataBindings.Add(New _
         Binding("Value", ds, "customers.CustToOrders.OrderDate"))
      ' Add event delegates for the Parse and Format events to a
      ' new Binding object, and add the object to the third
      ' TextBox control's BindingsCollection. The delegates
      ' must be added before adding the Binding to the
      ' collection; otherwise, no formatting occurs until
      ' the Current object of the BindingManagerBase for
      ' the data source changes.
      Dim b As Binding = New
 _
         Binding("Text", ds, "customers.custToOrders.OrderAmount")
      AddHandler b.Parse, AddressOf CurrencyStringToDecimal
      AddHandler b.Format, AddressOf DecimalToCurrencyString
      text3.DataBindings.Add(b)
      
         ' Get the BindingManagerBase for the Customers table.
         bmCustomers = Me.BindingContext(ds, "Customers")

         ' Get the BindingManagerBase for the Orders table using the
         ' RelationName.
         bmOrders = Me.BindingContext(ds, "customers.CustToOrders")
   End Sub

   Private Sub DecimalToCurrencyString(sender
 As Object, cevent As ConvertEventArgs)
      ' This method is the Format event handler. Whenever the 
      ' control displays a new value, the value is converted from 
      ' its native Decimal type to a string. The ToString method 
      ' then formats the value as a Currency, by using the 
      ' formatting character "c".

      ' The application can only convert to string type. 
   
      If Not cevent.DesiredType Is
 GetType(String) Then
         Exit Sub
      End If 
   
      cevent.Value = CType(cevent.Value, decimal).ToString("c")
   End Sub

   Private Sub CurrencyStringToDecimal(sender
 As Object, cevent As ConvertEventArgs)
      ' This method is the Parse event handler. The Parse event 
      ' occurs whenever the displayed value changes. The static 
      ' ToDecimal method of the Convert class converts the 
      ' value back to its native Decimal type.

      ' Can only convert to decimal type.
      If Not cevent.DesiredType Is
 GetType(decimal) Then
         Exit Sub
      End If

      cevent.Value = Decimal.Parse(cevent.Value.ToString, _
      NumberStyles.Currency, nothing)
      
      ' To see that no precision is lost, print the unformatted 
      ' value. For example, changing a value to "10.0001"
 
      ' causes the control to display "10.00", but the 
      ' unformatted value remains "10.0001".
      Console.WriteLine(cevent.Value)
   End Sub

   Private Sub button1_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the previous item in the Customer list.
      bmCustomers.Position -= 1
   End Sub

   Private Sub button2_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the next item in the Customer list.
      bmCustomers.Position += 1
   End Sub

   Private Sub button3_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the previous item in the Order list.
      bmOrders.Position -= 1
   End Sub

   Private Sub button4_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the next item in the Orders list.
      bmOrders.Position += 1
   End Sub

   ' Creates a DataSet with two tables and populates it.
   Private Sub MakeDataSet
      ' Create a DataSet.
      ds = New DataSet("myDataSet")

      ' Creates two DataTables.
      Dim tCust As DataTable = New
 DataTable("Customers")
      Dim tOrders As DataTable = New
 DataTable("Orders")

      ' Create two columns, and add them to the first table.
      Dim cCustID As DataColumn = New
 DataColumn("CustID", _
      System.Type.GetType("System.Int32"))
      Dim cCustName As DataColumn = New
 DataColumn("CustName")
      tCust.Columns.Add(cCustID)
      tCust.Columns.Add(cCustName)

      ' Create three columns, and add them to the second table.
      Dim cID As DataColumn = _
         New DataColumn("CustID",
 System.Type.GetType("System.Int32"))
      Dim cOrderDate As DataColumn = _
         New DataColumn("orderDate",
 System.Type.GetType("System.DateTime"))
      Dim cOrderAmount As DataColumn = _
         New DataColumn("OrderAmount",
 System.Type.GetType("System.Decimal"))
      tOrders.Columns.Add(cOrderAmount)
      tOrders.Columns.Add(cID)
      tOrders.Columns.Add(cOrderDate)

      ' Add the tables to the DataSet.
      ds.Tables.Add(tCust)
      ds.Tables.Add(tOrders)

      ' Create a DataRelation, and add it to the DataSet.
      Dim dr As DataRelation = New
 _
         DataRelation("custToOrders", cCustID, cID)
      ds.Relations.Add(dr)
      
      ' Populate the tables. For each customer and orders,
      ' create two DataRow variables.
      Dim newRow1 As DataRow
      Dim newRow2 As DataRow

         ' Create three customers in the Customers Table.
         Dim i As Integer
         For i = 1 to 3
            newRow1 = tCust.NewRow
            newRow1("custID") = i
            ' Adds the row to the Customers table.
            tCust.Rows.Add(newRow1)
         Next

         ' Give each customer a distinct name.
         tCust.Rows(0)("custName") = "Alpha"
         tCust.Rows(1)("custName") = "Beta"
         tCust.Rows(2)("custName") = "Omega"

         ' For each customer, create five rows in the Orders table.
         Dim j As Integer
         For i = 1 to 3
         For j = 1 to 5
            newRow2 = tOrders.NewRow
            newRow2("CustID") = i
            newRow2("orderDate") = New
 DateTime(2001, i, j * 2)
            newRow2("OrderAmount") = i * 10 + j *
 .1
            ' Add the row to the Orders table.
            tOrders.Rows.Add(newRow2)
         Next
         Next
   End Sub
End Class
using System;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
   private System.ComponentModel.Container components;
   private Button button1;
   private Button button2;
   private Button button3;
   private Button button4;
   private TextBox text1;
   private TextBox text2;
   private TextBox text3;

   private BindingManagerBase bmCustomers;
   private BindingManagerBase bmOrders;
   private DataSet ds;
   private DateTimePicker DateTimePicker1;

   public Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();
      // Call SetUp to bind the controls.
      SetUp();
   }
 
   private void InitializeComponent()
   {
      // Create the form and its controls.
      this.components = new System.ComponentModel.Container();
      this.button1 = new System.Windows.Forms.Button();
      this.button2 = new System.Windows.Forms.Button();
      this.button3 = new System.Windows.Forms.Button();
      this.button4 = new System.Windows.Forms.Button();
      
      this.text1= new System.Windows.Forms.TextBox();
      this.text2= new System.Windows.Forms.TextBox();
      this.text3= new System.Windows.Forms.TextBox();
      
      this.DateTimePicker1 = new DateTimePicker();
      
      this.Text = "Binding Sample";
      this.ClientSize = new System.Drawing.Size(450,
 200);
      
      button1.Location = new System.Drawing.Point(24, 16);
      button1.Size = new System.Drawing.Size(64, 24);
      button1.Text = "<";
      button1.Click+=new System.EventHandler(button1_Click);

      button2.Location = new System.Drawing.Point(90, 16);
      button2.Size = new System.Drawing.Size(64, 24);
      button2.Text = ">";
      button2.Click+=new System.EventHandler(button2_Click);

      button3.Location = new System.Drawing.Point(90, 100);
      button3.Size = new System.Drawing.Size(64, 24);
      button3.Text = "<";
      button3.Click+=new System.EventHandler(button3_Click);

      button4.Location = new System.Drawing.Point(150, 100);
      button4.Size = new System.Drawing.Size(64, 24);
      button4.Text = ">";
      button4.Click+=new System.EventHandler(button4_Click);

      text1.Location = new System.Drawing.Point(24, 50);
      text1.Size = new System.Drawing.Size(150, 24);

      text2.Location = new System.Drawing.Point(190, 50);
      text2.Size = new System.Drawing.Size(150, 24);

      text3.Location = new System.Drawing.Point(290, 150);
      text3.Size = new System.Drawing.Size(150, 24);
      
      DateTimePicker1.Location = new System.Drawing.Point(90,
 150);
      DateTimePicker1.Size = new System.Drawing.Size(200, 800);
      
      this.Controls.Add(button1);
      this.Controls.Add(button2);
      this.Controls.Add(button3);
      this.Controls.Add(button4);
      this.Controls.Add(text1);
      this.Controls.Add(text2);
      this.Controls.Add(text3);
      this.Controls.Add(DateTimePicker1);
   }

   protected override void Dispose( bool
 disposing ){
      if( disposing ){
         if (components != null){
            components.Dispose();}
      }
      base.Dispose( disposing );
   }
   public static void Main()
   {
      Application.Run(new Form1());
   }
   
   private void SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

   protected void BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
         controls. The data-bound property for both controls 
         is the Text property. The data source is a DataSet 
         (ds). The data member is the  
         "TableName.ColumnName" string. */
      text1.DataBindings.Add(new Binding
      ("Text", ds, "customers.custName"));
      text2.DataBindings.Add(new Binding
      ("Text", ds, "customers.custID"));
      
      /* Bind the DateTimePicker control by adding a new Binding.
 
         The data member of the DateTimePicker is a 
         TableName.RelationName.ColumnName string. */
      DateTimePicker1.DataBindings.Add(new 
      Binding("Value", ds, "customers.CustToOrders.OrderDate"));

      /* Add event delegates for the Parse and Format events to
 a 
         new Binding object, and add the object to the third 
         TextBox control's BindingsCollection. The delegates 
         must be added before adding the Binding to the 
         collection; otherwise, no formatting occurs until 
         the Current object of the BindingManagerBase for 
         the data source changes. */
         Binding b = new Binding
         ("Text", ds, "customers.custToOrders.OrderAmount");
      b.Parse+=new ConvertEventHandler(CurrencyStringToDecimal);
      b.Format+=new ConvertEventHandler(DecimalToCurrencyString);
      text3.DataBindings.Add(b);

      // Get the BindingManagerBase for the Customers table. 
      bmCustomers = this.BindingContext [ds, "Customers"];

      /* Get the BindingManagerBase for the Orders table using
 the 
         RelationName. */ 
      bmOrders = this.BindingContext[ds, "customers.CustToOrders"];
   }

   private void DecimalToCurrencyString(object
 sender, ConvertEventArgs cevent)
   {
      /* This method is the Format event handler. Whenever the 
         control displays a new value, the value is converted
 from 
         its native Decimal type to a string. The ToString method
 
         then formats the value as a Currency, by using the 
         formatting character "c". */

      // The application can only convert to string type. 
      if(cevent.DesiredType != typeof(string))
 return;

      cevent.Value = ((decimal) cevent.Value).ToString("c");
   }

   private void CurrencyStringToDecimal(object
 sender, ConvertEventArgs cevent)
   {   
      /* This method is the Parse event handler. The Parse event 
         occurs whenever the displayed value changes. The static
 
         ToDecimal method of the Convert class converts the 
         value back to its native Decimal type. */

      // Can only convert to decimal type.
      if(cevent.DesiredType != typeof(decimal)) return;

      cevent.Value = Decimal.Parse(cevent.Value.ToString(),
          NumberStyles.Currency, null);

      /* To see that no precision is lost, print the unformatted 
         value. For example, changing a value to "10.0001" 
         causes the control to display "10.00", but the 
         unformatted value remains "10.0001". */
      Console.WriteLine(cevent.Value);
   }

   private void button1_Click(object sender,
 System.EventArgs e)
   {
      // Go to the previous item in the Customer list.
      bmCustomers.Position -= 1;
   }

   private void button2_Click(object sender,
 System.EventArgs e)
   {
      // Go to the next item in the Customer list.
      bmCustomers.Position += 1;
   }
    
   private void button3_Click(object sender,
 System.EventArgs e)
   {
      // Go to the previous item in the Orders list.
      bmOrders.Position-=1;
   }

   private void button4_Click(object sender,
 System.EventArgs e)
   {
      // Go to the next item in the Orders list.
      bmOrders.Position+=1;
   }

   // Create a DataSet with two tables and populate it.
   private void MakeDataSet()
   {
      // Create a DataSet.
      ds = new DataSet("myDataSet");
      
      // Create two DataTables.
      DataTable tCust = new DataTable("Customers");
      DataTable tOrders = new DataTable("Orders");

      // Create two columns, and add them to the first table.
      DataColumn cCustID = new DataColumn("CustID",
 typeof(int));
      DataColumn cCustName = new DataColumn("CustName");
      tCust.Columns.Add(cCustID);
      tCust.Columns.Add(cCustName);

      // Create three columns, and add them to the second table.
      DataColumn cID = 
         new DataColumn("CustID", typeof(int));
      DataColumn cOrderDate = 
         new DataColumn("orderDate",typeof(DateTime));
      DataColumn cOrderAmount = 
         new DataColumn("OrderAmount", typeof(decimal));
      tOrders.Columns.Add(cOrderAmount);
      tOrders.Columns.Add(cID);
      tOrders.Columns.Add(cOrderDate);

      // Add the tables to the DataSet.
      ds.Tables.Add(tCust);
      ds.Tables.Add(tOrders);

      // Create a DataRelation, and add it to the DataSet.
      DataRelation dr = new DataRelation
      ("custToOrders", cCustID , cID);
      ds.Relations.Add(dr);
   
      /* Populate the tables. For each customer and order, 
         create two DataRow variables. */
      DataRow newRow1;
      DataRow newRow2;

      // Create three customers in the Customers Table.
      for(int i = 1; i < 4; i++)
      {
         newRow1 = tCust.NewRow();
         newRow1["custID"] = i;
         // Add the row to the Customers table.
         tCust.Rows.Add(newRow1);
      }
      // Give each customer a distinct name.
      tCust.Rows[0]["custName"] = "Alpha";
      tCust.Rows[1]["custName"] = "Beta";
      tCust.Rows[2]["custName"] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for(int i = 1; i < 4; i++)
      {
         for(int j = 1; j < 6; j++)
         {
            newRow2 = tOrders.NewRow();
            newRow2["CustID"]= i;
            newRow2["orderDate"]= new DateTime(2001,
 i, j * 2);
            newRow2["OrderAmount"] = i * 10 + j  * .1;
            // Add the row to the Orders table.
            tOrders.Rows.Add(newRow2);
         }
      }
   }
 }

#using <system.dll>
#using <system.data.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
#using <system.xml.dll>

using namespace System;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Globalization;
using namespace System::Windows::Forms;

#define null 0L
public ref class Form1: public
 Form
{
private:
   System::ComponentModel::Container^ components;
   Button^ button1;
   Button^ button2;
   Button^ button3;
   Button^ button4;
   TextBox^ text1;
   TextBox^ text2;
   TextBox^ text3;
   BindingManagerBase^ bmCustomers;
   BindingManagerBase^ bmOrders;
   DataSet^ ds;
   DateTimePicker^ DateTimePicker1;

public:
   Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();

      // Call SetUp to bind the controls.
      SetUp();
   }

private:
   void InitializeComponent()
   {
      // Create the form and its controls.
      this->components = gcnew System::ComponentModel::Container;
      this->button1 = gcnew Button;
      this->button2 = gcnew Button;
      this->button3 = gcnew Button;
      this->button4 = gcnew Button;
      this->text1 = gcnew TextBox;
      this->text2 = gcnew TextBox;
      this->text3 = gcnew TextBox;
      this->DateTimePicker1 = gcnew DateTimePicker;
      this->Text =  "Binding Sample";
      this->ClientSize = System::Drawing::Size( 450, 200 );
      button1->Location = System::Drawing::Point( 24, 16 );
      button1->Size = System::Drawing::Size( 64, 24 );
      button1->Text =  "<";
      button1->Click += gcnew System::EventHandler( this, &Form1::button1_Click
 );
      button2->Location = System::Drawing::Point( 90, 16 );
      button2->Size = System::Drawing::Size( 64, 24 );
      button2->Text =  ">";
      button2->Click += gcnew System::EventHandler( this, &Form1::button2_Click
 );
      button3->Location = System::Drawing::Point( 90, 100 );
      button3->Size = System::Drawing::Size( 64, 24 );
      button3->Text =  "<";
      button3->Click += gcnew System::EventHandler( this, &Form1::button3_Click
 );
      button4->Location = System::Drawing::Point( 150, 100 );
      button4->Size = System::Drawing::Size( 64, 24 );
      button4->Text =  ">";
      button4->Click += gcnew System::EventHandler( this, &Form1::button4_Click
 );
      text1->Location = System::Drawing::Point( 24, 50 );
      text1->Size = System::Drawing::Size( 150, 24 );
      text2->Location = System::Drawing::Point( 190, 50 );
      text2->Size = System::Drawing::Size( 150, 24 );
      text3->Location = System::Drawing::Point( 290, 150 );
      text3->Size = System::Drawing::Size( 150, 24 );
      DateTimePicker1->Location = System::Drawing::Point( 90, 150 );
      DateTimePicker1->Size = System::Drawing::Size( 200, 800 );
      this->Controls->Add( button1 );
      this->Controls->Add( button2 );
      this->Controls->Add( button3 );
      this->Controls->Add( button4 );
      this->Controls->Add( text1 );
      this->Controls->Add( text2 );
      this->Controls->Add( text3 );
      this->Controls->Add( DateTimePicker1 );
   }

public:
   ~Form1()
   {
      if ( components != nullptr )
      {
         delete components;
      }
   }

private:
   void SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

protected:
   void BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
              controls. The data-bound property for both controls
 
              is the Text property. The data source is a DataSet 
              (ds). The data member is the 
              "TableName.ColumnName" string. */
      text1->DataBindings->Add( gcnew Binding( "Text",ds,"customers.custName"
 ) );
      text2->DataBindings->Add( gcnew Binding( "Text",ds,"customers.custID"
 ) );

      /* Bind the DateTimePicker control by adding a new Binding.
 
              The data member of the DateTimePicker is a 
              TableName.RelationName.ColumnName string. */
      DateTimePicker1->DataBindings->Add( gcnew Binding( "Value",ds,"customers.CustToOrders.OrderDate"
 ) );

      /* Add event delegates for the Parse and Format events to
 a 
              new Binding object, and add the object to the third
 
              TextBox control's BindingsCollection. The delegates 
              must be added before adding the Binding to the 
              collection; otherwise, no formatting occurs until 
              the Current object of the BindingManagerBase for
 
              the data source changes. */
      Binding^ b = gcnew Binding( "Text",ds,"customers.custToOrders.OrderAmount"
 );
      b->Parse += gcnew ConvertEventHandler( this, &Form1::CurrencyStringToDecimal
 );
      b->Format += gcnew ConvertEventHandler( this, &Form1::DecimalToCurrencyString
 );
      text3->DataBindings->Add( b );

      // Get the BindingManagerBase for the Customers table. 
      bmCustomers = this->BindingContext[ ds, "Customers"
 ];

      /* Get the BindingManagerBase for the Orders table using
 the 
              RelationName. */
      bmOrders = this->BindingContext[ ds, "customers.CustToOrders"
 ];
   }

private:
   void DecimalToCurrencyString( Object^ /*sender*/, ConvertEventArgs^
 cevent )
   {
      /* This method is the Format event handler. Whenever the 
              control displays a new value, the value is converted
 from 
              its native Decimal type to a string. The ToString method
 
              then formats the value as a Currency, by using the
 
              formatting character "c". */
      // The application can only convert to string type. 
      if ( cevent->DesiredType != String::typeid )
            return;

      cevent->Value = (dynamic_cast<Decimal^>(cevent->Value))->ToString(
 "c" );
   }

   void CurrencyStringToDecimal( Object^ /*sender*/, ConvertEventArgs^
 cevent )
   {
      /* This method is the Parse event handler. The Parse event 
              occurs whenever the displayed value changes. The static
 
              ToDecimal method of the Convert class converts the
 
              value back to its native Decimal type. */
      // Can only convert to Decimal type.
      if ( cevent->DesiredType != Decimal::typeid )
            return;

      cevent->Value = Decimal::Parse( cevent->Value->ToString(), NumberStyles::Currency,
 nullptr );
      
      /* To see that no precision is lost, print the unformatted 
              value. For example, changing a value to "10.0001" 
              causes the control to display "10.00", but the 
              unformatted value remains "10.0001". */
      Console::WriteLine( cevent->Value );
   }

private:
   void button1_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Go to the previous item in the Customer list.
      bmCustomers->Position -= 1;
   }

   void button2_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Go to the next item in the Customer list.
      bmCustomers->Position += 1;
   }

   void button3_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Go to the previous item in the Orders list.
      bmOrders->Position = bmOrders->Position - 1;
   }

   void button4_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Go to the next item in the Orders list.
      bmOrders->Position = bmOrders->Position + 1;
   }

private:

   // Create a DataSet with two tables and populate it.
   void MakeDataSet()
   {
      // Create a DataSet.
      ds = gcnew DataSet( "myDataSet" );

      // Create two DataTables.
      DataTable^ tCust = gcnew DataTable( "Customers" );
      DataTable^ tOrders = gcnew DataTable( "Orders" );

      // Create two columns, and add them to the first table.
      DataColumn^ cCustID = gcnew DataColumn( "CustID",Int32::typeid );
      DataColumn^ cCustName = gcnew DataColumn( "CustName" );
      tCust->Columns->Add( cCustID );
      tCust->Columns->Add( cCustName );

      // Create three columns, and add them to the second table.
      DataColumn^ cID = gcnew DataColumn( "CustID",Int32::typeid );
      DataColumn^ cOrderDate = gcnew DataColumn( "orderDate",DateTime::typeid
 );
      DataColumn^ cOrderAmount = gcnew DataColumn( "OrderAmount",Decimal::typeid
 );
      tOrders->Columns->Add( cOrderAmount );
      tOrders->Columns->Add( cID );
      tOrders->Columns->Add( cOrderDate );

      // Add the tables to the DataSet.
      ds->Tables->Add( tCust );
      ds->Tables->Add( tOrders );

      // Create a DataRelation, and add it to the DataSet.
      DataRelation^ dr = gcnew DataRelation( "custToOrders",cCustID,cID
 );
      ds->Relations->Add( dr );
      
      /* Populate the tables. For each customer and order, 
              create two DataRow variables. */
      DataRow^ newRow1; // = new DataRow();

      DataRow^ newRow2; // = new DataRow();

      // Create three customers in the Customers Table.
      for ( int i = 1; i < 4; i++ )
      {
         newRow1 = tCust->NewRow();
         newRow1[ "custID" ] = i;
         
         // Add the row to the Customers table.
         tCust->Rows->Add( newRow1 );

      }
      tCust->Rows[ 0 ][ "custName" ] = "Alpha";
      tCust->Rows[ 1 ][ "custName" ] = "Beta";
      tCust->Rows[ 2 ][ "custName" ] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for ( int i = 1; i < 4; i++ )
      {
         for ( int j = 1; j < 6; j++ )
         {
            newRow2 = tOrders->NewRow();
            newRow2[ "CustID" ] = i;
            newRow2[ "orderDate" ] = System::DateTime( 2001, i, j * 2 );
            newRow2[ "OrderAmount" ] = i * 10 + j * .1;
            
            // Add the row to the Orders table.
            tOrders->Rows->Add( newRow2 );
         }
      }
   }
};

int main()
{
   Application::Run( gcnew Form1 );
}
import System.*;
import System.Data.*;
import System.Drawing.*;
import System.Globalization.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.ComponentModel.Container components;
    private Button button1;
    private Button button2;
    private Button button3;
    private Button button4;
    private TextBox text1;
    private TextBox text2;
    private TextBox text3;
    private BindingManagerBase bmCustomers;
    private BindingManagerBase bmOrders;
    private DataSet ds;
    private DateTimePicker dateTimePicker1;

    public Form1()
    {
        // Required for Windows Form Designer support.
        InitializeComponent();
        // Call SetUp to bind the controls.
        SetUp();
    } //Form1

    private void InitializeComponent()
    {
        // Create the form and its controls.
        this.components = new System.ComponentModel.Container();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.button3 = new System.Windows.Forms.Button();
        this.button4 = new System.Windows.Forms.Button();
        this.text1 = new System.Windows.Forms.TextBox();
        this.text2 = new System.Windows.Forms.TextBox();
        this.text3 = new System.Windows.Forms.TextBox();
        this.dateTimePicker1 = new DateTimePicker();
        this.set_Text("Binding Sample");
        this.set_ClientSize(new System.Drawing.Size(450,
 200));
        button1.set_Location(new System.Drawing.Point(24, 16));
        button1.set_Size(new System.Drawing.Size(64, 24));
        button1.set_Text("<");
        button1.add_Click(new System.EventHandler(button1_Click));
        button2.set_Location(new System.Drawing.Point(90, 16));
        button2.set_Size(new System.Drawing.Size(64, 24));
        button2.set_Text(">");
        button2.add_Click(new System.EventHandler(button2_Click));
        button3.set_Location(new System.Drawing.Point(90, 100));
        button3.set_Size(new System.Drawing.Size(64, 24));
        button3.set_Text("<");
        button3.add_Click(new System.EventHandler(button3_Click));
        button4.set_Location(new System.Drawing.Point(150, 100));
        button4.set_Size(new System.Drawing.Size(64, 24));
        button4.set_Text(">");
        button4.add_Click(new System.EventHandler(button4_Click));
        text1.set_Location(new System.Drawing.Point(24, 50));
        text1.set_Size(new System.Drawing.Size(150, 24));
        text2.set_Location(new System.Drawing.Point(190, 50));
        text2.set_Size(new System.Drawing.Size(150, 24));
        text3.set_Location(new System.Drawing.Point(290, 150));
        text3.set_Size(new System.Drawing.Size(150, 24));
        dateTimePicker1.set_Location(new System.Drawing.Point(90,
 150));
        dateTimePicker1.set_Size(new System.Drawing.Size(200,
 800));
        this.get_Controls().Add(button1);
        this.get_Controls().Add(button2);
        this.get_Controls().Add(button3);
        this.get_Controls().Add(button4);
        this.get_Controls().Add(text1);
        this.get_Controls().Add(text2);
        this.get_Controls().Add(text3);
        this.get_Controls().Add(dateTimePicker1);
    } //InitializeComponent

    protected void Dispose(boolean disposing)
    {
        if (disposing) {
            if (components != null) {
                components.Dispose();
            }
        }
        super.Dispose(disposing);
    } //Dispose

    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    private void SetUp()
    {
        // Create a DataSet with two tables and one relation.
        MakeDataSet();
        BindControls();
    } //SetUp

    protected void BindControls()
    {
        /* Create two Binding objects for the first two TextBox
 
           controls. The data-bound property for both controls
 
           is the Text property. The data source is a DataSet 
           (ds). The data member is the  
           "TableName.ColumnName" string. 
         */
        text1.get_DataBindings().Add(new Binding("Text",
 ds, 
            "customers.custName"));
        text2.get_DataBindings().Add(new Binding("Text",
 ds, 
            "customers.custID"));

        /* Bind the DateTimePicker control by adding a new Binding.
 
           The data member of the DateTimePicker is a 
           TableName.RelationName.ColumnName string. 
         */
        dateTimePicker1.get_DataBindings().Add(new Binding("Value",
 ds, 
            "customers.CustToOrders.OrderDate"));

        /* Add event delegates for the Parse and Format events to
 a 
           new Binding object, and add the object to the third
 
           TextBox control's BindingsCollection. The delegates 
           must be added before adding the Binding to the 
           collection; otherwise, no formatting occurs until 
           the Current object of the BindingManagerBase for 
           the data source changes. 
         */
        Binding b = new Binding("Text", ds, 
            "customers.custToOrders.OrderAmount");

        b.add_Parse(new ConvertEventHandler(CurrencyStringToDecimal));
        b.add_Format(new ConvertEventHandler(DecimalToCurrencyString));
        text3.get_DataBindings().Add(b);

        // Get the BindingManagerBase for the Customers table. 
        bmCustomers = this.get_BindingContext().get_Item(ds, "Customers");

        /* Get the BindingManagerBase for the Orders table using
 the 
           RelationName. 
         */
        bmOrders = this.get_BindingContext().get_Item(ds, 
            "customers.CustToOrders");
    } //BindControls

    private void DecimalToCurrencyString(Object
 sender, ConvertEventArgs cevent)
    {
        /* This method is the Format event handler. Whenever the 
           control displays a new value, the value is converted
 from 
           its native Decimal type to a string. The ToString method
 
           then formats the value as a Currency, by using the
 
           formatting character "c". 
         */

        // The application can only convert to string type. 
        if (!cevent.get_DesiredType().Equals(String.class.ToType()))
 {
            return;
        }
        cevent.set_Value(((System.Decimal)(cevent.get_Value())).ToString("c"));
    } //DecimalToCurrencyString

    private void CurrencyStringToDecimal(Object
 sender, ConvertEventArgs cevent)
    {
        /* This method is the Parse event handler. The Parse event 
           occurs whenever the displayed value changes. The static
 
           ToDecimal method of the Convert class converts the
 
           value back to its native Decimal type. 
         */

        // Can only convert to decimal type.
        if (!cevent.get_DesiredType().Equals(System.Decimal.class.ToType()))
 {
            return;
        }
        cevent.set_Value(Decimal.Parse(cevent.get_Value().ToString(), 
            NumberStyles.Currency, null));

        /* To see that no precision is lost, print the unformatted 
           value. For example, changing a value to "10.0001" 
           causes the control to display "10.00", but the 
           unformatted value remains "10.0001". 
         */
        Console.WriteLine(cevent.get_Value());
    } //CurrencyStringToDecimal

    protected void button1_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the previous item in the Customer list.
        bmCustomers.set_Position(bmCustomers.get_Position() - 1);
    } //button1_Click

    protected void button2_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the next item in the Customer list.
        bmCustomers.set_Position(bmCustomers.get_Position() + 1);
    } //button2_Click

    protected void button3_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the previous item in the Orders list.
        bmOrders.set_Position(bmOrders.get_Position() - 1);
    } //button3_Click

    protected void button4_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the next item in the Orders list.
        bmOrders.set_Position(bmOrders.get_Position() + 1);
    } //button4_Click

    // Create a DataSet with two tables and populate it.
    private void MakeDataSet()
    {
        // Create a DataSet.
        ds = new DataSet("myDataSet");

        // Create two DataTables.
        DataTable tCust = new DataTable("Customers");
        DataTable tOrders = new DataTable("Orders");

        // Create two columns, and add them to the first table.
        DataColumn cCustID = new DataColumn("CustID",
 int.class.ToType());
        DataColumn cCustName = new DataColumn("CustName");

        tCust.get_Columns().Add(cCustID);
        tCust.get_Columns().Add(cCustName);

        // Create three columns, and add them to the second table.
        DataColumn cID = new DataColumn("CustID", int.class.ToType());
        DataColumn cOrderDate = new DataColumn("orderDate",
 
            DateTime.class.ToType());
        DataColumn cOrderAmount = new DataColumn("OrderAmount",
 
            System.Decimal.class.ToType());

        tOrders.get_Columns().Add(cOrderAmount);
        tOrders.get_Columns().Add(cID);
        tOrders.get_Columns().Add(cOrderDate);

        // Add the tables to the DataSet.
        ds.get_Tables().Add(tCust);
        ds.get_Tables().Add(tOrders);

        // Create a DataRelation, and add it to the DataSet.
        DataRelation dr = new DataRelation("custToOrders",
 cCustID, cID);
        ds.get_Relations().Add(dr);

        /* Populate the tables. For each customer and order, 
           create two DataRow variables. 
         */
        DataRow newRow1;
        DataRow newRow2;

        // Create three customers in the Customers Table.
        for (int i = 1; i < 4; i++) {
            newRow1 = tCust.NewRow();
            newRow1.set_Item("custID", (Int32)i);
            // Add the row to the Customers table.
            tCust.get_Rows().Add(newRow1);
        }

        // Give each customer a distinct name.
        tCust.get_Rows().get_Item(0).set_Item("custName", "Alpha");
        tCust.get_Rows().get_Item(1).set_Item("custName", "Beta");
        tCust.get_Rows().get_Item(2).set_Item("custName", "Omega");

        // For each customer, create five rows in the Orders table.
        for (int i = 1; i < 4; i++) {
            for (int j = 1; j < 6; j++)
 {
                newRow2 = tOrders.NewRow();
                newRow2.set_Item("CustID", (Int32)i);
                newRow2.set_Item("orderDate", new DateTime(2001,
 i, j * 2));
                newRow2.set_Item("OrderAmount",    
                    (System.Double)(i * 10 + j * 0.1));
                // Add the row to the Orders table.
                tOrders.get_Rows().Add(newRow2);
            }
        }
    } //MakeDataSet
} //Form1
import System;
import System.Data;
import System.Drawing;
import System.Globalization;
import System.Windows.Forms;

public class Form1 extends
 System.Windows.Forms.Form
{
   private var components : System.ComponentModel.Container;
   private var button1 : Button;
   private var button2 : Button;
   private var button3 : Button;
   private var button4 : Button;
   private var text1 : TextBox;
   private var text2 : TextBox;
   private var text3 : TextBox;

   private var bmCustomers : BindingManagerBase;
   private var bmOrders : BindingManagerBase;
   private var ds : DataSet;
   private var DateTimePicker1 : DateTimePicker;

   public function Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();
      // Call SetUp to bind the controls.
      SetUp();
   }
 
   private function InitializeComponent()
   {
      // Create the form and its controls.
      this.components = new System.ComponentModel.Container();
      this.button1 = new System.Windows.Forms.Button();
      this.button2 = new System.Windows.Forms.Button();
      this.button3 = new System.Windows.Forms.Button();
      this.button4 = new System.Windows.Forms.Button();
      
      this.text1= new System.Windows.Forms.TextBox();
      this.text2= new System.Windows.Forms.TextBox();
      this.text3= new System.Windows.Forms.TextBox();
      
      this.DateTimePicker1 = new DateTimePicker();
      
      this.Text = "Binding Sample";
      this.ClientSize = new System.Drawing.Size(450,
 200);
      
      button1.Location = new System.Drawing.Point(24, 16);
      button1.Size = new System.Drawing.Size(64, 24);
      button1.Text = "<";
      button1.add_Click(button1_Click);

      button2.Location = new System.Drawing.Point(90, 16);
      button2.Size = new System.Drawing.Size(64, 24);
      button2.Text = ">";
      button2.add_Click(button2_Click);

      button3.Location = new System.Drawing.Point(90, 100);
      button3.Size = new System.Drawing.Size(64, 24);
      button3.Text = "<";
      button3.add_Click(button3_Click);

      button4.Location = new System.Drawing.Point(150, 100);
      button4.Size = new System.Drawing.Size(64, 24);
      button4.Text = ">";
      button4.add_Click(button4_Click);

      text1.Location = new System.Drawing.Point(24, 50);
      text1.Size = new System.Drawing.Size(150, 24);

      text2.Location = new System.Drawing.Point(190, 50);
      text2.Size = new System.Drawing.Size(150, 24);

      text3.Location = new System.Drawing.Point(290, 150);
      text3.Size = new System.Drawing.Size(150, 24);
      
      DateTimePicker1.Location = new System.Drawing.Point(90,
 150);
      DateTimePicker1.Size = new System.Drawing.Size(200, 800);
      
      this.Controls.Add(button1);
      this.Controls.Add(button2);
      this.Controls.Add(button3);
      this.Controls.Add(button4);
      this.Controls.Add(text1);
      this.Controls.Add(text2);
      this.Controls.Add(text3);
      this.Controls.Add(DateTimePicker1);
   }

   protected override function Dispose(disposing
 : boolean){
      if( disposing ){
         if (components != null){
            components.Dispose();}
      }
      super.Dispose( disposing );
   }

   public static function
 Main()
   {
      Application.Run(new Form1());
   }
   
   private function SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

   protected function BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
         controls. The data-bound property for both controls 
         is the Text property. The data source is a DataSet 
         (ds). The data member is the  
         "TableName.ColumnName" string. */
      text1.DataBindings.Add(new Binding
      ("Text", ds, "customers.custName"));
      text2.DataBindings.Add(new Binding
      ("Text", ds, "customers.custID"));
      
      /* Bind the DateTimePicker control by adding a new Binding.
 
         The data member of the DateTimePicker is a 
         TableName.RelationName.ColumnName string. */
      DateTimePicker1.DataBindings.Add(new 
      Binding("Value", ds, "customers.CustToOrders.OrderDate"));

      /* Add event delegates for the Parse and Format events to
 a 
         new Binding object, and add the object to the third 
         TextBox control's BindingsCollection. The delegates 
         must be added before adding the Binding to the 
         collection; otherwise, no formatting occurs until 
         the Current object of the BindingManagerBase for 
         the data source changes. */
      var b : Binding = new Binding
         ("Text", ds, "customers.custToOrders.OrderAmount");
      b.add_Parse(CurrencyStringToDecimal);
      b.add_Format(DecimalToCurrencyString);
      text3.DataBindings.Add(b);

      // Get the BindingManagerBase for the Customers table. 
      bmCustomers = this.BindingContext [ds, "Customers"];

      /* Get the BindingManagerBase for the Orders table using
 the 
         RelationName. */ 
      bmOrders = this.BindingContext[ds, "customers.CustToOrders"];
   }

   private function DecimalToCurrencyString(sender,
 cevent : ConvertEventArgs)
   {
      /* This method is the Format event handler. Whenever the 
         control displays a new value, the value is converted
 from 
         its native Decimal type to a string. The ToString method
 
         then formats the value as a Currency, by using the 
         formatting character "c". */

      // The application can only convert to string type. 
      if(cevent.DesiredType != String.GetType()) return;

      cevent.Value = (Decimal(cevent.Value)).ToString("c");
   }

   private function CurrencyStringToDecimal(sender,
 cevent : ConvertEventArgs)
   {   
      /* This method is the Parse event handler. The Parse event 
         occurs whenever the displayed value changes. The static
 
         ToDecimal method of the Convert class converts the 
         value back to its native Decimal type. */

      // Can only convert to Decimal type.
      if(cevent.DesiredType != Decimal.GetType()) return;

      cevent.Value = Decimal.Parse(cevent.Value.ToString(),
          NumberStyles.Currency, null);

      /* To see that no precision is lost, print the unformatted 
         value. For example, changing a value to "10.0001" 
         causes the control to display "10.00", but the 
         unformatted value remains "10.0001". */
      Console.WriteLine(cevent.Value);
   }

   protected function button1_Click(sender,
 e : System.EventArgs)
   {
      // Go to the previous item in the Customer list.
      bmCustomers.Position -= 1;
   }

   protected function button2_Click(sender,
 e : System.EventArgs)
   {
      // Go to the next item in the Customer list.
      bmCustomers.Position += 1;
   }
    
   protected function button3_Click(sender,
 e : System.EventArgs)
   {
      // Go to the previous item in the Orders list.
      bmOrders.Position-=1;
   }

   protected function button4_Click(sender,
 e : System.EventArgs)
   {
      // Go to the next item in the Orders list.
      bmOrders.Position+=1;
   }

   // Create a DataSet with two tables and populate it.
   private function MakeDataSet()
   {
      // Create a DataSet.
      ds = new DataSet("myDataSet");
      
      // Create two DataTables.
      var tCust : DataTable = new DataTable("Customers");
      var tOrders : DataTable= new DataTable("Orders");

      // Create two columns, and add them to the first table.
      var cCustID : DataColumn = new DataColumn("CustID",
 Int32);
      var cCustName : DataColumn = new DataColumn("CustName");
      tCust.Columns.Add(cCustID);
      tCust.Columns.Add(cCustName);

      // Create three columns, and add them to the second table.
      var cID : DataColumn  = 
         new DataColumn("CustID", Int32);
      var cOrderDate : DataColumn  = 
         new DataColumn("orderDate", DateTime);
      var cOrderAmount : DataColumn = 
         new DataColumn("OrderAmount", Decimal);
      tOrders.Columns.Add(cOrderAmount);
      tOrders.Columns.Add(cID);
      tOrders.Columns.Add(cOrderDate);

      // Add the tables to the DataSet.
      ds.Tables.Add(tCust);
      ds.Tables.Add(tOrders);

      // Create a DataRelation, and add it to the DataSet.
      var dr : DataRelation = new DataRelation
      ("custToOrders", cCustID , cID);
      ds.Relations.Add(dr);
   
      /* Populate the tables. For each customer and order, 
         create two DataRow variables. */
      var newRow1 : DataRow;
      var newRow2 : DataRow;

      // Create three customers in the Customers Table.
      for(var i : int =
 1; i < 4; i++)
      {
         newRow1 = tCust.NewRow();
         newRow1["custID"] = i;
         // Add the row to the Customers table.
         tCust.Rows.Add(newRow1);
      }
      // Give each customer a distinct name.
      tCust.Rows[0]["custName"] = "Alpha";
      tCust.Rows[1]["custName"] = "Beta";
      tCust.Rows[2]["custName"] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for(var j : int =
 1; j < 4; j++)
      {
         for(var k : int
 = 1; k < 6; k++)
         {
            newRow2 = tOrders.NewRow();
            newRow2["CustID"]= j;
            newRow2["orderDate"]= new DateTime(2001,
 j, k * 2);
            newRow2["OrderAmount"] = j * 10 + k  * .1;
            // Add the row to the Orders table.
            tOrders.Rows.Add(newRow2);
         }
      }
   }
 }

継承階層継承階層
System.Object
  System.Windows.Forms.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding メンバ
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding コンストラクタ (String, Object, String, Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

データ ソース指定したデータ メンバに、指定したコントロール プロパティバインドし、オプション書式設定適用できるようにする、Binding クラス新しインスタンス初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

formattingEnabled

表示されるデータ書式指定する場合trueそれ以外場合false

例外例外
例外種類条件

ArgumentException

propertyName指定されプロパティコントロールにありません。

または

指定されプロパティ読み取り専用です。

Exception

書式無効である場合propertyName は、コントロール有効なプロパティでも、空の文字列 ("") でもありません。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String)

データ ソース指定したデータ メンバに、指定したコントロール プロパティを単純バインドする、Binding クラス新しインスタンス初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String

Dim instance As New Binding(propertyName,
 dataSource, dataMember)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

例外例外
例外種類条件

Exception

propertyName が、コントロール有効なプロパティでも、空の文字列 ("") でもありません。

ArgumentException

propertyName指定されプロパティコントロールにありません。

解説解説

データ ソースとして、次のいずれかクラスインスタンス指定できます

dataMember 文字列作成方法については、Binding クラストピック参照してください

コントロールプロパティ対すバインディング作成すると、新しBinding は、バインド先のコントロールによって公開されるイベント検査し2 つイベント結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

存在しないプロパティバインドようとすると、Bindingコントロールの Control.DataBindings コレクション追加されるときに ArgumentExceptionスローさます。

使用例使用例

myDataSet という名前の DataSet 内のテーブルの列に、TextBox コントロールバインドするコード例次に示します。この例では、モジュール宣言セクションmyDataSet宣言していることを前提にしています。

Private Sub CreateDataSet
   myDataSet = new DataSet("myDataSet")
   ' Populates the DataSet with tables, relations, and
   ' constraints.
End Sub

Private Sub BindTextBoxToDataSet 
   ' Binds a TextBox control to a column in the DataSet.
   textBox1.DataBindings.Add _
   ("Text", myDataSet, "Suppliers.CompanyName")
End Sub
private void CreateDataSet()
{
   myDataSet = new DataSet("myDataSet");
   /* Populates the DataSet with tables, relations, and 
      constraints. */
}

private void BindTextBoxToDataSet()
{
   /* Binds a TextBox control to a DataColumn named
   CompanyName in the DataTable named Suppliers. */
   textBox1.DataBindings.Add
   ("Text", myDataSet, "Suppliers.CompanyName");
}
   
private:
   void CreateDataSet()
   {
      myDataSet = gcnew DataSet( "myDataSet" );
      /* Populates the DataSet with tables, relations, and 
         constraints. */
   }

   void BindTextBoxToDataSet()
   {
      /* Binds a TextBox control to a DataColumn named
      CompanyName in the DataTable named Suppliers. */
      textBox1->DataBindings->Add(
         "Text", myDataSet, "Suppliers.CompanyName" );
   }
private void CreateDataSet()
{
    myDataSet = new DataSet("myDataSet");
} //CreateDataSet

/* Populates the DataSet with tables, relations, and 
   constraints. 
 */
private void BindTextBoxToDataSet()
{
    /* Binds a TextBox control to a DataColumn named
       CompanyName in the DataTable named Suppliers. 
     */
    textBox1.get_DataBindings().Add("Text", myDataSet, 
        "Suppliers.CompanyName");
} //BindTextBoxToDataSet
private function CreateDataSet()
{
   myDataSet = new DataSet("myDataSet");
      
   // Creates a DataTable
   var myDataTable : DataTable = new DataTable("Suppliers");

   // Creates two columns, 
   var id : DataColumn = new DataColumn("ID",
 int);
   var name : DataColumn = new DataColumn("CompanyName",
 System.String);
   myDataTable.Columns.Add(id);
   myDataTable.Columns.Add(name);

   // Adds the table to the DataSet.
   myDataSet.Tables.Add(myDataTable);

   // Creates three suppliers in the Suppliers Table.
   var dr : DataRow;

   for(var i : int = 1;
 i < 4; i++)
   {
     dr = myDataTable.NewRow();
     dr[0] = i;
     dr[1] = "Company " + i.ToString();

     myDataTable.Rows.Add(dr);
   }   
}

private function BindTextBoxToDataSet()
{
   /* Binds a TextBox control to a DataColumn named
   CompanyName in the DataTable named Suppliers. */
   textBox1.DataBindings.Add
   (new Binding("Text", myDataSet, "Suppliers.CompanyName"));
}
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding クラス
Binding メンバ
System.Windows.Forms 名前空間
BindingsCollection
CurrencyManager

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプション書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したできます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

formattingEnabled

表示されるデータ書式指定する場合trueそれ以外場合false

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ

例外例外
解説解説

データ ソースとして、次のいずれかクラスインスタンス指定できます

dataMember 文字列作成方法については、Binding クラストピック参照してください

コントロールプロパティ対すバインディング作成すると、新しBinding は、バインド先のコントロールによって公開されるイベント検査し2 つイベント結び付けます。

  • Control.Validating.

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする Binding クラス新しインスタンス初期化します。オプション書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull返され場合使用されるプロパティ値を指定することもできます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

formattingEnabled

表示されるデータ書式指定する場合trueそれ以外場合false

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ

nullValue

データ ソースの値が DBNull である場合バインドされたコントロールプロパティ適用される Object

例外例外
解説解説

データ ソースとして、次のいずれかクラスインスタンス指定できます

dataMember 文字列作成方法については、Binding クラストピック参照してください

コントロールプロパティ対すバインディング作成すると、新しBinding は、バインド先のコントロールによって公開されるイベント検査し2 つイベント結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object, String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプションで、指定した書式指定文字列書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull返され場合使用されるプロパティ値を指定したり、書式プロバイダ指定することもできます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object, _
    formatString As String _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object
Dim formatString As String

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue, formatString)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue,
    string formatString
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue, 
    String^ formatString
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue, 
    String formatString
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object, 
    formatString : String
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

formattingEnabled

表示されるデータ書式指定する場合trueそれ以外場合false

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ

nullValue

データ ソースの値が DBNull である場合バインドされたコントロールプロパティ適用される Object

formatString

値の表方法を示す 1 つ上の書式指定子文字。

例外例外
解説解説

データ ソースとして、次のいずれかクラスインスタンス指定できます

dataMember 文字列作成方法については、Binding クラストピック参照してください

コントロールプロパティ対すバインディング作成すると、新しBinding は、バインド先のコントロールによって公開されるイベント検査し2 つイベント結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプションで、指定した書式指定文字列書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull返され場合使用されるプロパティ値を指定したり、書式プロバイダ指定することもできます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object, _
    formatString As String, _
    formatInfo As IFormatProvider _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object
Dim formatString As String
Dim formatInfo As IFormatProvider

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue, formatString,
 formatInfo)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue,
    string formatString,
    IFormatProvider formatInfo
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue, 
    String^ formatString, 
    IFormatProvider^ formatInfo
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue, 
    String formatString, 
    IFormatProvider formatInfo
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object, 
    formatString : String, 
    formatInfo : IFormatProvider
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object

dataMember

バインド先のプロパティまたはリスト

formattingEnabled

表示されるデータ書式指定する場合trueそれ以外場合false

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ

nullValue

データ ソースの値が DBNull である場合バインドされたコントロールプロパティ適用される Object

formatString

値の表方法を示す 1 つ上の書式指定子文字。

formatInfo

既定書式指定動作オーバーライドする IFormatProvider の実装

例外例外
解説解説

データ ソースとして、次のいずれかクラスインスタンス指定できます

dataMember 文字列作成方法については、Binding クラストピック参照してください

コントロールプロパティ対すバインディング作成すると、新しBinding は、バインド先のコントロールによって公開されるイベント検査し2 つイベント結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ


Binding コンストラクタ

Binding クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Binding (String, Object, String) データ ソース指定したデータ メンバに、指定したコントロール プロパティを単純バインドする、Binding クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean) データ ソース指定したデータ メンバに、指定したコントロール プロパティバインドし、オプション書式設定適用できるようにする、Binding クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode) 指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプション書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したできます

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object) 指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする Binding クラス新しインスタンス初期化します。オプション書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返され場合使用されるプロパティ値を指定することもできます

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object, String) 指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプションで、指定した書式指定文字列書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull返され場合使用されるプロパティ値を指定したり、書式プロバイダ指定することもできます

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider) 指定したデータ ソース指定したデータ メンバに、指定したコントロール プロパティバインドする、Binding クラス新しインスタンス初期化します。オプションで、指定した書式指定文字列書式有効にしたり、特定の更新設定基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull返され場合使用されるプロパティ値を指定したり、書式プロバイダ指定することもできます

.NET Compact Framework によってサポートされています。

参照参照

関連項目

Binding クラス
Binding メンバ
System.Windows.Forms 名前空間
BindingsCollection
CurrencyManager

Binding フィールド


プロテクト フィールドプロテクト フィールド

  名前 説明
プロテクト フィールド defaultMember  
プロテクト フィールド isAssignmentToDefaultIndexedProperty  
プロテクト フィールド isFullyResolved  
プロテクト フィールド isNonVirtual  
プロテクト フィールド name  
参照参照

Binding プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンステキスト ドキュメント取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItemドキュメント要素取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1準拠する WSDL属性拡張機能を表す XmlAttribute 型の配列取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされますXML Web サービス使用する機能拡張要素コレクション取得します
パブリック プロパティ Name  項目の名前を取得または設定します。 ( NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクト生成されるときに名前空間プレフィックス名前空間保持するために使用する名前空間プレフィックス名前空間のディクショナリを取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ Operations XML Web サービスサポートされているアクション使用するデータ形式およびメッセージ プロトコル仕様コレクション取得します
パブリック プロパティ ServiceDescription Binding がメンバとして含まれている ServiceDescription取得します
パブリック プロパティ Type Binding関連付けられている PortType の名前空間限定名を表す値を取得または設定します
参照参照

関連項目

Binding クラス
System.Web.Services.Description 名前空間

Binding プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ PropertyName コントロールデータ連結プロパティの名前を取得または設定します
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding メソッド


Binding メソッド


Binding メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding メンバ

Binding データ型公開されるメンバを以下の表に示します


プロテクト フィールドプロテクト フィールド
  名前 説明
プロテクト フィールド defaultMember  
プロテクト フィールド isAssignmentToDefaultIndexedProperty  
プロテクト フィールド isFullyResolved  
プロテクト フィールド isNonVirtual  
プロテクト フィールド name  
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド GetObject  
プロテクト メソッド HandleNoSuchMemberError  
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド ResolveRHValue  
プロテクト メソッド TranslateToILObject  
プロテクト メソッド TranslateToILWithDupOfThisOb  
参照参照

Binding メンバ

XML Web サービス使用される具象データ形式およびプロトコル指定します。このクラス継承できません。

Binding データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド Binding  
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンステキスト ドキュメント取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItemドキュメント要素取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1準拠する WSDL属性拡張機能を表す XmlAttribute 型の配列取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされますXML Web サービス使用する機能拡張要素コレクション取得します
パブリック プロパティ Name  項目の名前を取得または設定します。(NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクト生成されるときに名前空間プレフィックス名前空間保持するために使用する名前空間プレフィックス名前空間のディクショナリを取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ Operations XML Web サービスサポートされているアクション使用するデータ形式およびメッセージ プロトコル仕様コレクション取得します
パブリック プロパティ ServiceDescription Binding がメンバとして含まれている ServiceDescription取得します
パブリック プロパティ Type Binding関連付けられている PortType の名前空間限定名を表す値を取得または設定します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

Binding クラス
System.Web.Services.Description 名前空間

Binding メンバ

オブジェクトプロパティ値とコントロールプロパティ値との間の単純バインディング表します

Binding データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ PropertyName コントロールデータ連結プロパティの名前を取得または設定します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

バインディング[binding]

ギターなどのネックボディの縁を飾る装飾のことを指す。

バインディング

【英】:binding

ボディネックヘッドストックなどの角に沿って付けられ縁飾りのこと。楽器の角を衝撃から保護する役割も持つ。

素材には、セルロイド木材貝殻などが使われる


Binding

名前 ビンディングバインディング; ビンディンク; ビンデング

FREEing

(binding から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2024/02/17 06:30 UTC 版)

株式会社FREEing(フリーイング)は、神奈川県横浜市中区にある企業[1]


  1. ^ a b 株式会社FREEingの情報”. 法人番号公表サイト. 国税庁. 2021年7月24日閲覧。
  2. ^ COMPANY PROFLIE”. FREEing. 2021年7月24日閲覧。
  3. ^ PRODUCTS”. FREEing. 2021年7月24日閲覧。
  4. ^ 実登3206026”. 特許情報プラットフォーム. 工業所有権情報・研修館. 2021年7月24日閲覧。
  5. ^ タイツを履いていないバージョンのフィギュアを、「生足バニーVer.」として取り扱っている。
  6. ^ 【初出し画像もあり!】テーブル美術館シリーズ生みの親に直撃インタビュー!【読み応え抜群!】”. グッスマらぼ. グッドスマイルカンパニー. 2021年7月24日閲覧。
  7. ^ 株式会社BINDingの情報”. 法人番号公表サイト. 国税庁. 2021年9月8日閲覧。


「FREEing」の続きの解説一覧

バインディング

(binding から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2022/06/12 09:44 UTC 版)

ナビゲーションに移動 検索に移動

バインディング

  • 束縛 (コンピュータ): binding) - コンピュータにおいて、主に「対応付け」や「関連付け」などの意味で用いられる。
  • データバインディング: data binding) - データベースなどとソフトウェア上の対象オブジェクトを結びつける技術。
  • スノーボードでブーツをボードに取り付けるための器具。
  • スキーでブーツを板に取り付けるための部品。ビンドング(: Bindung)の英語読み。ビンディングを参照。
  • スポーツ自転車用のペダルのうち、トークリップとストラップによらずに靴をペダルに固定する機構を有するもの。
  • ギターなどのボディやネック、ヘッドストックの縁に施される装飾部品のこと。角を衝撃から保護する役目を果たす。

関連項目




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「binding」の関連用語

bindingのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



bindingのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
実用日本語表現辞典実用日本語表現辞典
Copyright © 2024実用日本語表現辞典 All Rights Reserved.
デジタル大辞泉デジタル大辞泉
(C)Shogakukan Inc.
株式会社 小学館
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.
ヤマハミュージックメディアヤマハミュージックメディア
Copyright(C) 2000-2024 YAMAHA MUSIC MEDIA CORPORATION. All Rights Reserved.
ヤマハミュージックメディア音楽用語ダス
楽器探そう!デジマート楽器探そう!デジマート
Copyright(c)2024 Rittor Music Inc., a company of Impress Group. All right reserved.
日外アソシエーツ株式会社日外アソシエーツ株式会社
Copyright (C) 1994- Nichigai Associates, Inc., All rights reserved.
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアのFREEing (改訂履歴)、バインディング (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。

©2024 GRAS Group, Inc.RSS