System.Data.OracleClient.OracleDataReader.GetInt32 C# (CSharp) Метод

GetInt32() публичный Метод

public GetInt32 ( int i ) : int
i int
Результат int
		public override int GetInt32(int i) {
			if (IsNumeric(i))
				return GetInt32Safe(i);

			return base.GetInt32(i);
		}

Usage Example

        /*
         * Finding the difference between the start booking date and end booking date
         * to calculate the cost of a booking
         */
        public void calculateBookingCost(DateTimePicker startDate, DateTimePicker endDate, ComboBox cbo_Description, TextBox txt_Cost)
        {
            connection.Close();

            DateTime dt1 = Convert.ToDateTime(startDate.Text);
            DateTime dt2 = Convert.ToDateTime(endDate.Text);

            TimeSpan timeSpan = dt2 - dt1;
            int numberOfDays = timeSpan.Days;

            string query_String = "SELECT Car_Rate FROM Car_Class WHERE Description ='" + cbo_Description.Text + "'";

            connection.Open();

            try
            {
                cmd = connection.CreateCommand();
                cmd.CommandText = query_String;
                data_reader = cmd.ExecuteReader();//the reader is used to read in the required record

                if (data_reader.HasRows)
                {
                    data_reader.Read();

                    txt_Cost.Text = ("" + data_reader.GetInt32(0) * numberOfDays);

                }
                connection.Close();
            }
            catch (Exception) { }
        }
All Usage Examples Of System.Data.OracleClient.OracleDataReader::GetInt32