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