I have menu name names stored in a SQL server table. I need to fetch this menus, loop through them and disable on the main form. I have been unable to to do so. Please assist.
Private Sub Disablemenus()
Dim cnn As New SqlConnection(My.Settings.mycString)
Dim cmd As New SqlCommand
Dim dr2 As SqlDataReader
' Dim cmenuname As ToolStripMenuItem
cmd.Connection = cnn
cmd.CommandType = CommandType.Text
cmd.CommandText = "select MenuName from table1 where Allowed=0)"
dr2 = cmd.ExecuteReader
Do While dr2.Read = True
'disable the menu