Cannot retrieve value of key column for given column family.

Mar 29, 2013 at 6:19 AM
Hi Guys,

I have below column family in Cassandra.

CREATE TABLE t (
k int PRIMARY KEY,
other text
)
INSERT INTO t (k, other) VALUES (1, 'AAA');
INSERT INTO t (k, other) VALUES (2, 'BBB');
INSERT INTO t (k, other) VALUES (3, 'CCC');
INSERT INTO t (k, other) VALUES (4, 'DDD');
INSERT INTO t (k, other) VALUES (5, 'EEE');

but while retrieving the records in c# i am not getting the key values k.

List<t> list = null;
    CqlResult retrieveResult = null;
    using (var context = new CassandraContext(_Host, _Port, _KeySpace))
    {
        string retrieveCql = "select * from t"; 
        retrieveResult = context.ExecuteCqlQuery(retrieveCql);
        list = retrieveResult.ToObjectList<t>();
        list.RemoveAll(x => x == null);
    }
    gvT.DataSource = list;
    gvT.DataBind();
where class looks like

[Serializable]
public class t
{
public int k { get; set; }
public string other { get; set; }
}

Please let me know if i am missing anything.