Click here to Skip to main content
15,914,500 members
Home / Discussions / Database
   

Database

 
GeneralSQLServer and XML RAW Pin
Guillermo Rivero29-Sep-03 7:45
Guillermo Rivero29-Sep-03 7:45 
GeneralRe: SQLServer and XML RAW Pin
Mike Dimmick1-Oct-03 12:43
Mike Dimmick1-Oct-03 12:43 
GeneralRe: SQLServer and XML RAW Pin
Guillermo Rivero3-Oct-03 2:37
Guillermo Rivero3-Oct-03 2:37 
GeneralPrimary Key as a Foreign Key Pin
DotNet_Newbie29-Sep-03 6:44
DotNet_Newbie29-Sep-03 6:44 
GeneralRe: Primary Key as a Foreign Key Pin
STW2-Oct-03 22:40
STW2-Oct-03 22:40 
Generalado.net Pin
Member 23171029-Sep-03 0:37
Member 23171029-Sep-03 0:37 
GeneralRe: ado.net Pin
Roger Wright29-Sep-03 5:17
professionalRoger Wright29-Sep-03 5:17 
GeneralWinforms - Menu Generation from SQL Database at runtime Pin
sunny12328-Sep-03 22:47
sunny12328-Sep-03 22:47 
Hi,

I need to generate menus at runtime for a sample Windows application. I'm using vs.net winforms with c#.

Every user in the application does not have access to all menu options, so the menu items being displayed is as per user login.

I need to generate the form code at run-time. Any info you can provide OR links about this particular topic will be very helpful and appreciated with a zillion thanx...

It seems i need to following at runtime...

1) Retrieve data from the sql database about the menu options available to the current user

2) Declare each Menu item
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
...


2) Initialize each menu item
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
...

3) Declare Menu Collections - add list of menuitems

this.mainMenu1.MenuItems.AddRange(new
System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem5});

...

4) Define each Menu Item
i.e. specify Index, Shortcut Key, Text (with hotkey) and declare eventhandler for each Menu item

this.menuItem2.Index = 0;
this.menuItem2.Shortcut=
System.Windows.Forms.Shortcut.CtrlN;
this.menuItem2.Text = "&New";
this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click);

5) Assign the menu to Form as the current menu
this.Menu= mainMenu1;

Hope u guys will be keen to help. Thanx in advance.

Sunny.
GeneralRe: Winforms - Menu Generation from SQL Database at runtime Pin
Guillermo Rivero29-Sep-03 8:09
Guillermo Rivero29-Sep-03 8:09 
GeneralRe: Winforms - Menu Generation from SQL Database at runtime Pin
sunny12329-Sep-03 20:47
sunny12329-Sep-03 20:47 
GeneralConcurrency violation: the UpdateCommand affected 0 records. Pin
falbala27-Sep-03 3:32
falbala27-Sep-03 3:32 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
Mike Dimmick27-Sep-03 11:56
Mike Dimmick27-Sep-03 11:56 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
falbala12-Oct-03 0:27
falbala12-Oct-03 0:27 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
Wjousts30-Sep-03 9:05
Wjousts30-Sep-03 9:05 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
falbala12-Oct-03 0:29
falbala12-Oct-03 0:29 
Generalbatch Pin
sardinka26-Sep-03 5:04
sardinka26-Sep-03 5:04 
GeneralRe: batch Pin
Anonymous26-Sep-03 11:34
Anonymous26-Sep-03 11:34 
GeneralSQL Server Yukon Pin
nevhile.net26-Sep-03 1:20
nevhile.net26-Sep-03 1:20 
GeneralRe: SQL Server Yukon Pin
Mike Dimmick26-Sep-03 3:25
Mike Dimmick26-Sep-03 3:25 
GeneralDisplay XSLT transformed XMLDataDocument from FOR XML EXPLICIT query in SQL Server 2000 Pin
drikusr25-Sep-03 20:39
drikusr25-Sep-03 20:39 
GeneralRe: Display XSLT transformed XMLDataDocument from FOR XML EXPLICIT query in SQL Server 2000 Pin
drikusr29-Sep-03 17:11
drikusr29-Sep-03 17:11 
GeneralUpdating DataTable that has an expression column Pin
Dr_Sh0ck25-Sep-03 15:41
Dr_Sh0ck25-Sep-03 15:41 
GeneralRe: Updating DataTable that has an expression column Pin
Guillermo Rivero29-Sep-03 12:12
Guillermo Rivero29-Sep-03 12:12 
GeneralRe: Updating DataTable that has an expression column Pin
Member 79899372-Oct-03 21:51
Member 79899372-Oct-03 21:51 
GeneralUsing CASE..END in OPENXML Pin
mittalpa25-Sep-03 11:54
mittalpa25-Sep-03 11:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.