Exemplo n.º 1
0
        private int GetValue(OleDbDataReader oData)
        {
            int intValue;
            string strFieldType;

            strFieldType = Convert.ToString(oData.GetFieldType(0));

            switch (strFieldType)
            {
                case "System.Int16":
                    intValue = Convert.ToInt32(oData.GetInt16(0));
                    break;

                case "System.Int32":
                    intValue = oData.GetInt32(0);
                    break;

                case "System.Double":
                    intValue = Convert.ToInt32(oData.GetDouble(0));
                    break;

                default:
                    intValue = oData.GetInt32(0);
                    break;

            }

            return intValue;
        }