R
RAO
Hi
I new to C# progrmming. I have taken a sample code from the internet and
try to compile it. I am getting the error
'A namespace does not directly contain members such as fields or methods'
and the code is
----------------------
using System;
using System.Data;
using System.Data.ADO;
Namespace DBAccess
{
public class DBRead
{
public ADODataReader DataReader(string DBStr,string strSQL)
{
// Create the connection
ADOConnection oCn = new ADOConnection(DBStr);
//Create the Command Object
ADOCommand oCm = new ADOCommand(strSQL,oCn);
//Open the connection
oCn.Open();
//Create a null DataReader Object
ADODataReader oDr ;
//Execute the SQL Query
oCm.Execute(out oDr);
// Return the DataReader
return oDr;
}
}
}
----------------------
Any idea what is wrong with this code.
TIA
RAO
I new to C# progrmming. I have taken a sample code from the internet and
try to compile it. I am getting the error
'A namespace does not directly contain members such as fields or methods'
and the code is
----------------------
using System;
using System.Data;
using System.Data.ADO;
Namespace DBAccess
{
public class DBRead
{
public ADODataReader DataReader(string DBStr,string strSQL)
{
// Create the connection
ADOConnection oCn = new ADOConnection(DBStr);
//Create the Command Object
ADOCommand oCm = new ADOCommand(strSQL,oCn);
//Open the connection
oCn.Open();
//Create a null DataReader Object
ADODataReader oDr ;
//Execute the SQL Query
oCm.Execute(out oDr);
// Return the DataReader
return oDr;
}
}
}
----------------------
Any idea what is wrong with this code.
TIA
RAO