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

DataGridAttendance

in my C# program I use:
objDa.Fill(ds,"all_tables");
DataGridAttendance.DataSource = ds.Table["all_tables"];

I got error as below after I compiled.
The name 'DataGridAttendance' does not exit in the current context.

I have .NET 2.
Please help.

tks

Jul 28 '06 #1
3 1096
"blackdog" <cl***@hotmail.coma écrit dans le message de news:
11*********************@i42g2000cwa.googlegroups.c om...

| in my C# program I use:
| objDa.Fill(ds,"all_tables");
| DataGridAttendance.DataSource = ds.Table["all_tables"];
|
| I got error as below after I compiled.
| The name 'DataGridAttendance' does not exit in the current context.

The fact that DataGridAttendance starts with an upper case letter and has no
number at the end, indicates to me that you are trying to talk to the class
and not the instance.

But without more code, it is difficult to help you. You need to at least let
us see the private field declaration for the grid component.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Jul 28 '06 #2
This is my program as below, please help, I am new in C# Thanks

using System;
using System.Data;
using System.Data.Common;
using System.Data.OracleClient;
class Example
{
OracleConnection con;

void Connect()
{

con = new OracleConnection();
con.ConnectionString = "User Id=xxxxxxx;Password=xxxxxxx;Data
Source=xxxxxxx";
con.Open();
Console.WriteLine("Connected to Oracle" + con.ServerVersion);
String strCommand;
strCommand = "select table_name from all_tables";
OracleCommand objCommand = new OracleCommand(strCommand,con);

DataSet ds = new DataSet();

OracleDataAdapter objDa = new OracleDataAdapter(objCommand);
objDa.Fill(ds,"all_tables");
DataGridAttendance.DataSource = ds.Tables["all_tables"];
DataGridAttendance.DataBind();
DataGrid.Columns[index].HeaderText;
}
Joanna Carter [TeamB] wrote:
"blackdog" <cl***@hotmail.coma écrit dans le message de news:
11*********************@i42g2000cwa.googlegroups.c om...

| in my C# program I use:
| objDa.Fill(ds,"all_tables");
| DataGridAttendance.DataSource = ds.Table["all_tables"];
|
| I got error as below after I compiled.
| The name 'DataGridAttendance' does not exit in the current context.

The fact that DataGridAttendance starts with an upper case letter and hasno
number at the end, indicates to me that you are trying to talk to the class
and not the instance.

But without more code, it is difficult to help you. You need to at least let
us see the private field declaration for the grid component.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Jul 28 '06 #3
"blackdog" <cl***@hotmail.coma écrit dans le message de news:
11**********************@i3g2000cwc.googlegroups.c om...

This is my program as below, please help, I am new in C# Thanks

DataGridAttendance.DataSource = ds.Tables["all_tables"];
DataGridAttendance.DataBind();
DataGrid.Columns[index].HeaderText;

So, what is DataGridAttendance ?

Where do you declare it ?

What is DataGrid ?

Where do you declare it ?

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Jul 28 '06 #4

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

Similar topics

1
by: | last post by:
Is it possible to bind to a datagrid the result of a select with several tables? With one table, I have : mySel = "Select statement"; ... DA.Fill(DSAtt, "intemp");...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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.