SetDataBinding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    #1

    SetDataBinding

    Hi guys,
    I'm new in developing applicationa in C# and I have a
    very strange effect to display my data in the DataGrid:

    the method SetDataBinding is unknown for my DataGrid

    I use the following codesample:
    myDataGrid.SetD ataBinding(myDa taSet, "Customers" );

    please can you help me?

    Thanks...
  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: SetDataBinding

    This is the example you see in the Microsoft .NET help file:

    private void SetSourceAndMem ber(){

    DataSet myDataSet = new DataSet("myData Set");
    DataTable tableCustomers = new DataTable("Cust omers");
    myDataSet.Table s.Add(tableCust omers);
    // Insert code to populate the DataSet.

    // Set DataSource and DataMember with SetDataBinding method.
    string member;
    // The name of a DataTable is Customers.
    member = "Customers" ;
    dataGrid1.SetDa taBinding(myDat aSet, member);
    }

    The SetDataBinding is a runtime method, which is useful if you are dealing
    with the possibility of reuse (ie, you can set multiple tables to the
    DataGrid, depending on your needs). You can also bind the specific table,
    like so:

    dataGrid1.DataS ource = myDataSet.Table s[0].DefaultView;
    dataGrid1.DataB ind();

    The tables collection can also be accessed by name.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************** *************** *************** *************** **********
    Think Outside the Box!
    *************** *************** *************** *************** **********
    "Michael" <huhubinjanuric h@hotmail.com> wrote in message
    news:07f501c397 05$b7a4fe20$a50 1280a@phx.gbl.. .[color=blue]
    > Hi guys,
    > I'm new in developing applicationa in C# and I have a
    > very strange effect to display my data in the DataGrid:
    >
    > the method SetDataBinding is unknown for my DataGrid
    >
    > I use the following codesample:
    > myDataGrid.SetD ataBinding(myDa taSet, "Customers" );
    >
    > please can you help me?
    >
    > Thanks...[/color]


    Comment

    • Guest's Avatar

      #3
      Re: SetDataBinding

      I used the example from the Microsoft .NET help file
      but the interesting thing is, that the
      method "SetDataBinding " is unknown!

      Is it possible, that something is missing or wrong in my
      installation?

      I use visual .net 2003 enterprise developer and a C#
      project for mobile devices...

      [color=blue]
      >-----Original Message-----
      >This is the example you see in the Microsoft .NET help[/color]
      file:[color=blue]
      >
      >private void SetSourceAndMem ber(){
      >
      > DataSet myDataSet = new DataSet("myData Set");
      > DataTable tableCustomers = new DataTable("Cust omers");
      > myDataSet.Table s.Add(tableCust omers);
      > // Insert code to populate the DataSet.
      >
      > // Set DataSource and DataMember with SetDataBinding[/color]
      method.[color=blue]
      > string member;
      > // The name of a DataTable is Customers.
      > member = "Customers" ;
      > dataGrid1.SetDa taBinding(myDat aSet, member);
      >}
      >
      >The SetDataBinding is a runtime method, which is useful[/color]
      if you are dealing[color=blue]
      >with the possibility of reuse (ie, you can set multiple[/color]
      tables to the[color=blue]
      >DataGrid, depending on your needs). You can also bind[/color]
      the specific table,[color=blue]
      >like so:
      >
      >dataGrid1.Data Source = myDataSet.Table s[0].DefaultView;
      >dataGrid1.Data Bind();
      >
      >The tables collection can also be accessed by name.
      >
      >--
      >Gregory A. Beamer
      >MVP; MCP: +I, SE, SD, DBA
      >
      >************** *************** *************** *************[/color]
      *************[color=blue]
      >Think Outside the Box!
      >************** *************** *************** *************[/color]
      *************[color=blue]
      >"Michael" <huhubinjanuric h@hotmail.com> wrote in message
      >news:07f501c39 705$b7a4fe20$a5 01280a@phx.gbl. ..[color=green]
      >> Hi guys,
      >> I'm new in developing applicationa in C# and I have a
      >> very strange effect to display my data in the DataGrid:
      >>
      >> the method SetDataBinding is unknown for my DataGrid
      >>
      >> I use the following codesample:
      >> myDataGrid.SetD ataBinding(myDa taSet, "Customers" );
      >>
      >> please can you help me?
      >>
      >> Thanks...[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...