Re: bajom

From Rock3r, 8 Years ago, written in C#, viewed 3'273 times. This paste is a reply to bajom from Rock3r - go back
URL https://paste.godclan.hu/view/IMWNNQhI/diff Shorturl Error: Input provided by user is not valid Embed
Viewing differences between bajom and Re: bajom
        /*Elotte sokszar*/                                                
                                                        button8.Visible = false; //register
                                                        button9.Visible = false; //login
                                                        button7.Visible = false; //adminpanel
                                                        button11.Visible = true; //logout
                                                        button6.Visible = true; //csillag
                                                        button13.Visible = true; //settings
                                                        
                                                        
                                                        OleDbConnection c = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source='db.mdb'");
                                                        OleDbDataAdapter a = new OleDbDataAdapter();
                                                        
                                                        try{
                                                                c.Open();
                                                                
                                                                OleDbCommand s = new OleDbCommand("SELECT * FROM Bookmarks WHERE login = '" + op.nev + "'",c);
                                                                OleDbDataReader r = s.ExecuteReader();
                                                                OleDbCommand s1 = new OleDbCommand("SELECT COUNT(*) FROM Bookmarks WHERE login = '" + op.nev + "' AND btype = 'Elektrotechnika'",c);
                                                                int x = Convert.ToInt32(s1.ExecuteScalar());
                                                                MessageBox.Show(Convert.ToString(x));
                                                                tbnev = new string[x];
                                                                tburl = new string[x];
                                                                tbdate = new string[x];
                                                                

                                                                
                                                                while(r.Read()){
                                                                        
                                                                        tbnev[db] = r.GetString(2);
                                                                        tburl[db] = r.GetString(3);
                                                                        tbdate[db] = r.GetString(4);
                                                                        db++;
                                                                        
                                                                }
                                                                r.Close();
                                                                
                                                                int poz = 113;
                                                    foreach (string index in tbnev)
                                                    {
                                                        Button button = new Button();
                                                        button.Location = new System.Drawing.Point(poz, 6);
                                                        button.Name = index;
                                                        button.Size = new System.Drawing.Size(75, 23);
                                                        button.TabIndex = 0;
                                                        button.Text = index;
                                                        button.UseVisualStyleBackColor = true;
                                                        button.Click += new System.EventHandler(Button14Click); // Itt kene atadni az tburl tombot, nem?
                                                        poz += 90;
                                                        panel1.Controls.Add(button);
                                                    }
                                                        }catch(Exception ex){
                                                                MessageBox.Show("hiba"+ ex);
                                                        }

/* EVENT */
void Button14Click(object sender, EventArgs e, string[] url)
e)
                {
                        MessageBox.Show(Convert.ToString(url[0]));
Show(sender.ToString());
                }


Reply to "Re: bajom"

Here you can reply to the paste above