Q:

can we use object as a array or dictionary in C#

    connection.Open();
    SqlDataReader reader = command.ExecuteReader();
    while (reader.Read())
    {
           context.Response.Write(reader["timestamp"]);
    }
    reader.Close()

here we see, the reader is a SqlDataReader Object, but we use it as an array below,how it convert?

A:

You are not using reader as an array, you are using its indexer to access the data for the column called "timestamp".
The indexer returns an object, which you can then cast to the appropriate type.
Alternatively, you can use more specific methods like reader.GetSqlDateTime(), which return a specific, appropriate type.

