473,394 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.SetDataBinding(myDataSet, "Customers");

please can you help me?

Thanks...
Nov 15 '05 #1
2 5698
This is the example you see in the Microsoft .NET help file:

private void SetSourceAndMember(){

DataSet myDataSet = new DataSet("myDataSet");
DataTable tableCustomers = new DataTable("Customers");
myDataSet.Tables.Add(tableCustomers);
// 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.SetDataBinding(myDataSet, 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.DataSource = myDataSet.Tables[0].DefaultView;
dataGrid1.DataBind();

The tables collection can also be accessed by name.

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

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Michael" <hu*************@hotmail.com> wrote in message
news:07****************************@phx.gbl...
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.SetDataBinding(myDataSet, "Customers");

please can you help me?

Thanks...

Nov 15 '05 #2
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...

-----Original Message-----
This is the example you see in the Microsoft .NET help file:
private void SetSourceAndMember(){

DataSet myDataSet = new DataSet("myDataSet");
DataTable tableCustomers = new DataTable("Customers");
myDataSet.Tables.Add(tableCustomers);
// 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.SetDataBinding(myDataSet, member);
}

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

dataGrid1.DataSource = myDataSet.Tables[0].DefaultView;
dataGrid1.DataBind();

The tables collection can also be accessed by name.

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

************************************************* ******** *************Think Outside the Box!
************************************************* ******** *************"Michael" <hu*************@hotmail.com> wrote in message
news:07****************************@phx.gbl...
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.SetDataBinding(myDataSet, "Customers");

please can you help me?

Thanks...

.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
0
by: hillscottc | last post by:
I have two DataAdapters....1)daStandard does a SELECT *, and 2)daDuplicates uses a stored proc which returns only rows with some duplicate data. Problem is, when I butRefresh_Click and I have...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
19
by: juli jul | last post by:
Hello, I would like to know if there is a function which is running during the runtime of my program all the time and where I could place events overloading and things I need to check during the...
0
by: Tin Man | last post by:
I am trying to change my datagrid source by resetting the datasource property. It wasn't working so I looked in the docs and it said the I have to use the SetDataBinging method of the datagrid. ...
0
by: Sam | last post by:
Hello all, Would someone explain the differenct between using datagrid SetDataBinding method at runtime and using DataSource and DataMember of datagrid? Regards, Sam
7
by: Mike | last post by:
i have a small difficulties with BindingSource and dataGridView bind db has properly opened and bind doesn't works. Unfortunately I didn't find any good example how to connect MS Access with...
3
by: codefragment | last post by:
Hi I want to bind a datagrid to a dataset for the table "ProductProductPhoto" in the AdventureWorks database in SQL Server 2005, however I can't because the binding fails on...
5
by: cj | last post by:
VB 2003 allowed datagrid1.datasource = catds.tables("calls") and also datagrid1.setdatabinding(catds, "calls") What was the difference? I not sure I ever knew. Now in VB2005 there is no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.