How to bind database to menu strip in windows form application?
I want to create dynamic menus in windows application?
plz help me....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Sep 15, 2012, 2:14 AM
tblMenu shoud be like this
mnuID
Description
10
File
20
Edit
Create tblsubMenu as follows
MenuText
10
New
10
Open
20
Cut
20
Copy
if you need you can add more
I used Mysql database you can change it to SQL if you are using SQL
check out my attachment of code inorder to find database driven menus..
Pravinkumar BirajdarPosted Sep 20, 2012, 9:37 AM
Dorababu MekaPosted Sep 20, 2012, 7:29 AM
Pravinkumar BirajdarPosted Sep 19, 2012, 11:31 PM
Dorababu MekaPosted Sep 18, 2012, 7:35 AM
Form1 f1 = new Form1();
f1.ShowDialog(); or f1.Show();
Pravinkumar BirajdarPosted Sep 17, 2012, 8:01 AM
Pravinkumar BirajdarPosted Sep 15, 2012, 9:31 AM
Dorababu MekaPosted Sep 15, 2012, 9:11 AM
Pravinkumar BirajdarPosted Sep 15, 2012, 8:17 AM
But plz can you tell me that how to add form name object to each menu so that it can be opened at click event
Pravinkumar BirajdarPosted Sep 15, 2012, 12:56 AM
Dorababu MekaPosted Sep 14, 2012, 11:18 PM
Pravinkumar BirajdarPosted Sep 14, 2012, 10:34 PM
Satyapriya NayakPosted Sep 14, 2012, 12:43 PM
Dorababu MekaPosted Sep 14, 2012, 9:09 AM
In page load get all your necessary connections and required fields from database
if(datareader.HasRows)
{
MenuStrip menu=new MenuStrip();
menu.Items.Add(datareader[0].Tostring());
}
Try some thing like this you can also assign dataset values as per we did for combo box binding or grid binding in asp.net.