Thanks HuwR,
I did it this way, I am not sure about the performance stuff though...
public void mainNav(int idMenu)
{
string strMenu = null;
SqlConnection connection = new SqlConnection("server=SPARK\\ISO;uid=xxxxxx;pwd=xxxxx;database=ISODB");
connection.Open();
SqlCommand command = new SqlCommand("select module_name, module_url,module_id FROM audiWS_Menu where parent_module=0", connection);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
strMenu +="<div class='main'>";
strMenu +="<div class='mainnav_line_";
if (reader.GetInt32(2) == Convert.ToInt32(idMenu))
strMenu +="on";
else
strMenu +="off";
strMenu +="'></div>";
strMenu +="<div class='mainnav_entry_txt";
if (reader.GetInt32(2) == Convert.ToInt32(idMenu))
strMenu +="_on";
strMenu +="'><a href='"+reader.GetString(1)+"'>"+reader.GetString(0)+"</a></div></div>";
}
mainNavItems.Text = strMenu;
reader.Close();
connection.Close();
}