We can build the hyperlink content in the loop of datarows and then assign it to the innerHTML of div.
SqlDataAdapter adapter;
DataTable dt;
string mystr;
adapter = new SqlDataAdapter("Select catid, catname from category", myconnstring);
adapter.Fill(dt);
mystr = "";
foreach (DataRow dr in dt.Rows)
{
mystr = mystr + "<a href='category.aspx?refid=" + dr("catid") + "'>" + dr("catname") + "</a></br>";
}
mydiv.InnerHtml = mystr;