473,386 Members | 1,710 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,386 software developers and data experts.

unknown method

I'm using windows forms!
-----Original Message-----
Are you using ASP.NET or Windows Form? Only Windows FormsDataGrid support that method.

Tu-Thach
-----Original Message-----
I'm using the following codesample:
myDataGrid.SetDataBinding(myDataSet, "Customers");
I used the code example from the Microsoft .NET help filebut the interesting thing is, that the
method "SetDataBinding" is unknown!

Is it possible, that something is missing or wrong in myinstallation?
please can you help me?

Thanks...
.

.

Nov 15 '05 #1
3 2464
Please post part of your code.

Tu-Thach
-----Original Message-----
I'm using windows forms!
-----Original Message-----
Are you using ASP.NET or Windows Form? Only Windows

Forms
DataGrid support that method.

Tu-Thach
-----Original Message-----
I'm using the following codesample:
myDataGrid.SetDataBinding(myDataSet, "Customers");
I used the code example from the Microsoft .NET helpfilebut the interesting thing is, that the
method "SetDataBinding" is unknown!

Is it possible, that something is missing or wrong inmyinstallation?
please can you help me?

Thanks...
.

.

.

Nov 15 '05 #2
here are parts of my used code:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Globalization;

.....
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Data.DataSet myDataSet;
....

private void MakeDataTables()
{
// Run all of the functions.
MakeParentTable();
MakeChildTable();
MakeDataRelation();
BindToDataGrid();
}

private void MakeParentTable()
{
// Create a new DataTable.
System.Data.DataTable myDataTable = new DataTable
("ParentTable");

// Declare variables for DataColumn and DataRow objects.
DataColumn myDataColumn;
DataRow myDataRow;

myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType
("System.Int32");
myDataColumn.ColumnName = "id";
myDataColumn.ReadOnly = true;
myDataColumn.Unique = true;
// Add the Column to the DataColumnCollection.
myDataTable.Columns.Add(myDataColumn);

// Create second column.
myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType
("System.String");
myDataColumn.ColumnName = "ParentItem";
myDataColumn.AutoIncrement = false;
myDataColumn.Caption = "ParentItem";
myDataColumn.ReadOnly = false;
myDataColumn.Unique = false;
// Add the column to the table.
myDataTable.Columns.Add
(myDataColumn);

// Make the ID column the primary
key column.
DataColumn[] PrimaryKeyColumns =
new DataColumn[1];
PrimaryKeyColumns[0] =
myDataTable.Columns["id"];
myDataTable.PrimaryKey =
PrimaryKeyColumns;

// Instantiate the DataSet
variable.
myDataSet = new DataSet();
// Add the new DataTable to the
DataSet.
myDataSet.Tables.Add(myDataTable);

// Create three new DataRow
objects and add them to the DataTable
for (int i = 0; i<= 2; i++)
{
myDataRow =
myDataTable.NewRow();
myDataRow["id"] = i;
myDataRow["ParentItem"]
= "ParentItem " + i;
myDataTable.Rows.Add
(myDataRow);
}
}

private void MakeChildTable()
{
// Create a new DataTable.
DataTable myDataTable = new
DataTable("childTable");
DataColumn myDataColumn;
DataRow myDataRow;

// Create first column and add to
the DataTable.
myDataColumn = new DataColumn();
myDataColumn.DataType=
System.Type.GetType("System.Int32");
myDataColumn.ColumnName
= "ChildID";
myDataColumn.AutoIncrement = true;
myDataColumn.Caption = "ID";
myDataColumn.ReadOnly = true;
myDataColumn.Unique = true;
// Add the column to the
DataColumnCollection.
myDataTable.Columns.Add
(myDataColumn);

// Create second column.
myDataColumn = new DataColumn();
myDataColumn.DataType=
System.Type.GetType("System.String");
myDataColumn.ColumnName
= "ChildItem";
myDataColumn.AutoIncrement =
false;
myDataColumn.Caption
= "ChildItem";
myDataColumn.ReadOnly = false;
myDataColumn.Unique = false;
myDataTable.Columns.Add
(myDataColumn);

// Create third column.
myDataColumn = new DataColumn();
myDataColumn.DataType=
System.Type.GetType("System.Int32");
myDataColumn.ColumnName
= "ParentID";
myDataColumn.AutoIncrement =
false;
myDataColumn.Caption = "ParentID";
myDataColumn.ReadOnly = false;
myDataColumn.Unique = false;
myDataTable.Columns.Add
(myDataColumn);

myDataSet.Tables.Add(myDataTable);
// Create three sets of DataRow
objects, five rows each, and add to DataTable.
for(int i = 0; i <= 4; i ++)
{
myDataRow =
myDataTable.NewRow();
myDataRow["childID"] = i;
myDataRow["ChildItem"]
= "Item " + i;
myDataRow["ParentID"] =
0 ;
myDataTable.Rows.Add
(myDataRow);
}
for(int i = 0; i <= 4; i ++)
{
myDataRow =
myDataTable.NewRow();
myDataRow["childID"] = i
+ 5;
myDataRow["ChildItem"]
= "Item " + i;
myDataRow["ParentID"] =
1 ;
myDataTable.Rows.Add
(myDataRow);
}
for(int i = 0; i <= 4; i ++)
{
myDataRow =
myDataTable.NewRow();
myDataRow["childID"] = i
+ 10;
myDataRow["ChildItem"]
= "Item " + i;
myDataRow["ParentID"] =
2 ;
myDataTable.Rows.Add
(myDataRow);
}
}

private void MakeDataRelation()
{
// DataRelation requires two
DataColumn (parent and child) and a name.
DataRelation myDataRelation;
DataColumn parentColumn;
DataColumn childColumn;
parentColumn = myDataSet.Tables
["ParentTable"].Columns["id"];
childColumn = myDataSet.Tables
["ChildTable"].Columns["ParentID"];
myDataRelation = new DataRelation
("parent2Child", parentColumn, childColumn);
myDataSet.Tables
["ChildTable"].ParentRelations.Add(myDataRelation);
}

private void BindToDataGrid()
{
// Instruct the DataGrid to bind
to the DataSet, with the
// ParentTable as the topmost
DataTable.
dataGrid1.SetDataBinding
(myDataSet,"ParentTable");
}

it's the same code from the help-file

and the effect is that the the method "SetDataBinding" is
not known for my datagrid
thanks for your help

it's also possibe to anwer me to my email adress



-----Original Message-----
Please post part of your code.

Tu-Thach
-----Original Message-----
I'm using windows forms!
-----Original Message-----
Are you using ASP.NET or Windows Form? Only Windows

Forms
DataGrid support that method.

Tu-Thach

-----Original Message-----
I'm using the following codesample:
myDataGrid.SetDataBinding(myDataSet, "Customers");
I used the code 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?
please can you help me?

Thanks...
.

.

.

.

Nov 15 '05 #3
and the error message is:

System.Windows.Forms.DataGrid includes no definition for
SetDataBinding
what's going wrong there?
Nov 15 '05 #4

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

Similar topics

3
by: Maarten van Reeuwijk | last post by:
Hello, I am using the Numeric package, and I need to strip edge cells off an array (dimension unknown) in an a-priori unknown direction. I implented this as follows: def el_remove_bcells(var,...
0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
4
by: David Moore | last post by:
Hello I am using the System.DirectoryServices namespace classes to access Active Directory. We connect using the LDAP://DOMAIN method. The code works on local dev boxes, and in staging, but...
6
by: SHC | last post by:
Hi all, I created an application from the Console Application (.NET) of VC++ .NET 2003, and I did "Build" the application of the attached .cpp file, volcanoes.xml and geology.dtd on my VC++ .NET...
1
by: Jung | last post by:
I am trying to make connection to Content Manager. Can anyone help me how to fix this error? Thank you. Exception in thread "main" java.lang.UnsatisfiedLinkError: SQLAllocEnv at...
9
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
9
by: Alexander Widera | last post by:
hi, is it possible to return an object of an unknown (but not really unknown) type with an method? i have the following situation: - a variable (A) of the type "object" which contains the...
1
by: nelsonivan | last post by:
Hi, i'm trying to reference some objects using reflection and Late Binding accessing. The Object API to his methods it's easy to understand, and it's as "Object.Method" - aka....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.