I am using MVC and JSON and a bunch of other things that are new to me, but my basic problem is this (please don't think I am in the wrong forum. This is a database question, I believe...)

How do I take something hardcoded like this:
Code:
        public JsonResult GridData(string sidx, string sord, int page, int rows)
        {
            int totalPages = 1; // we'll implement later
            int pageSize = rows;
            int totalRecords = 3; // implement later

            var jsonData = new
            {
                total = totalPages,
                page = page,
                records = totalRecords,
                rows = new[]{
                    new {id = 1, cell = new[] {"1", "-7", "Is this a good question?"}},
                    new {id = 2, cell = new[] {"2", "15", "Is this a blatant ripoff?"}},
                    new {id = 3, cell = new[] {"3", "23", "Why is the sky blue?"}}
                }
            };
            return Json(jsonData);
        }
and change the "rows" section to get back three rows (or more) from a stored procedure call? If I get back a dataset, I would have my three rows. But how do I process the dataset using a loop such as this?

The big picture of what I want to do is get data that will be presented in a grid and serialize it so it's JSON and the client can process it. Most of my work is done for me in this snippet, except I'm stuck on the most critical part!

Thanks.