Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff9-Mar-14 23:28
professionalBillWoodruff9-Mar-14 23:28 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
daddy35611-Mar-14 5:38
daddy35611-Mar-14 5:38 
QuestionInsert into sql fails. Pin
Member 1063165027-Feb-14 16:12
Member 1063165027-Feb-14 16:12 
AnswerRe: Insert into sql fails. Pin
ScottM127-Feb-14 20:31
ScottM127-Feb-14 20:31 
AnswerRe: Insert into sql fails. Pin
V.27-Feb-14 20:53
professionalV.27-Feb-14 20:53 
AnswerRe: Insert into sql fails. Pin
Mycroft Holmes28-Feb-14 13:15
professionalMycroft Holmes28-Feb-14 13:15 
GeneralRe: Insert into sql fails. Pin
Member 106409593-Mar-14 19:22
Member 106409593-Mar-14 19:22 
QuestionImage from Database to Button.Image C# Pin
Member 1022824227-Feb-14 4:30
Member 1022824227-Feb-14 4:30 
C#
private void AddProducts()
        {

            int i = 1;
            
            foreach (TabPage tp in tabControl1.TabPages)
            { 
            ObjectQuery<tblProducts> filteredProduct=new ObjectQuery<tblProducts>("Select value p from tblProducts as p where p.ProductType="+i,afos);
            
            FlowLayoutPanel flp = new FlowLayoutPanel();
            flp.Dock = DockStyle.Fill;
                foreach(tblProducts tprod in filteredProduct)
                {
                Button b = new Button();
                b.Size = new Size(100, 100);
                b.Image = tprod.ProductImage;
                    b.Text=tprod.ProductName;
                    b.Tag = tprod;
                    b.Click += new EventHandler(UpdateProductList);
                    flp.Controls.Add(b);

                   

                }
                tp.Controls.Add(flp);
                i++;

            }
        }


Please help. I want to automatically call an image from the database and make it an image in the button..I have managed to have the Button automatically add depending on the number of Products on the database, there's no solid button. My only problem is to have the button's image set automatically from the images in the database.
Thank you so much.
AnswerRe: Image from Database to Button.Image C# Pin
Richard Andrew x6427-Feb-14 11:57
professionalRichard Andrew x6427-Feb-14 11:57 
AnswerRe: Image from Database to Button.Image C# Pin
Ahmed Bensaid28-Feb-14 6:01
professionalAhmed Bensaid28-Feb-14 6:01 
QuestionDataContractSerializer objects conversion performace improvement Pin
impeham27-Feb-14 2:34
impeham27-Feb-14 2:34 
AnswerRe: DataContractSerializer objects conversion performace improvement Pin
BillWoodruff27-Feb-14 8:00
professionalBillWoodruff27-Feb-14 8:00 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham27-Feb-14 11:49
impeham27-Feb-14 11:49 
GeneralReason for my downvote Pin
Wayne Gaylard27-Feb-14 18:54
professionalWayne Gaylard27-Feb-14 18:54 
GeneralRe: Reason for my downvote Pin
impeham28-Feb-14 7:16
impeham28-Feb-14 7:16 
AnswerRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani28-Feb-14 8:14
professionalRavi Bhavnani28-Feb-14 8:14 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham28-Feb-14 10:07
impeham28-Feb-14 10:07 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani28-Feb-14 10:13
professionalRavi Bhavnani28-Feb-14 10:13 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham28-Feb-14 10:16
impeham28-Feb-14 10:16 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham2-Mar-14 5:07
impeham2-Mar-14 5:07 
AnswerRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani2-Mar-14 5:15
professionalRavi Bhavnani2-Mar-14 5:15 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham3-Mar-14 0:51
impeham3-Mar-14 0:51 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani3-Mar-14 2:10
professionalRavi Bhavnani3-Mar-14 2:10 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham3-Mar-14 2:42
impeham3-Mar-14 2:42 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani3-Mar-14 2:46
professionalRavi Bhavnani3-Mar-14 2:46 

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.