string ConnStr = GetConnectionString_Oracle(); // string ConnStr = ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString; using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = ConnStr; connection.Open(); Console.WriteLine("State: {0}", connection.State); Console.WriteLine("ConnectionString: {0}", connection.ConnectionString); OracleCommand command = connection.CreateCommand(); string sql = "select * from LCLDocMst where LossType ='" + lblLossType.Text.TrimStart() + "'"; command.CommandText = sql; OracleDataReader reader = command.ExecuteReader(); DataTable dataTable = new DataTable(); dataTable.Load(reader); gvDetails.DataSource = dataTable; //while (reader.Read()) //{ // myField = reader.GetInt32(0); //} }
command.CommandType = CommandType.Text;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)