Click here to Skip to main content
15,886,830 members
Home / Discussions / C#
   

C#

 
AnswerRe: OOPS Case Study Pin
thatraja4-Jun-12 17:21
professionalthatraja4-Jun-12 17:21 
GeneralRe: OOPS Case Study Pin
Richard MacCutchan4-Jun-12 22:28
mveRichard MacCutchan4-Jun-12 22:28 
GeneralRe: OOPS Case Study Pin
egenis5-Jun-12 21:09
egenis5-Jun-12 21:09 
AnswerRe: OOPS Case Study Pin
Richard MacCutchan4-Jun-12 22:31
mveRichard MacCutchan4-Jun-12 22:31 
QuestionSystem.Net.Sockets IPEndPoint Problem Pin
Midnight Ahri4-Jun-12 0:06
Midnight Ahri4-Jun-12 0:06 
AnswerRe: System.Net.Sockets IPEndPoint Problem Pin
Richard MacCutchan4-Jun-12 1:05
mveRichard MacCutchan4-Jun-12 1:05 
AnswerRe: System.Net.Sockets IPEndPoint Problem Pin
Luc Pattyn4-Jun-12 4:14
sitebuilderLuc Pattyn4-Jun-12 4:14 
QuestionSaving data to SQL from dynamically made comboboxes... Pin
Vidor3-Jun-12 22:27
professionalVidor3-Jun-12 22:27 
Hi Guys,
I've made a program to read data from an SQL database and show those in dynamic comboboxes. Now I would like to save all data back to SQL database after changes was made in those comboboxes.
Any ideea how to accomplish this?

Best regards
Vidor

C#
public void showRequill()
        {
            DataSet dsRequill = new DataSet();
            BindingSource bsRequill = new BindingSource();
            SqlDataAdapter daRequill = new SqlDataAdapter();
            DataTable dtRequill = new DataTable();

            int cnt = 0;

            try
            {
                daRequill.SelectCommand = new SqlCommand("select * from RD1 where UserNumber='" + cbWorkerNr.Text + "'", CN);
                daRequill.Fill(dsRequill);
                daRequill.Fill(dtRequill);
                bsRequill.DataSource = dsRequill.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            foreach (DataColumn column in dtRequill.Columns)
            {
                newLabel = new Label();
                newCombo = new ComboBox();
                
                newLabel.Text = column.ColumnName;
                newLabel.AutoSize = true;
                newLabel.Visible = true;

                newCombo.Size = new Size(35, 21);
                newCombo.Items.AddRange(new object[] { "U", "S", "E", "B", "L" });
                newCombo.Name = "cbRequill_" + cnt.ToString();
                newCombo.Visible = true;
                newCombo.DataBindings.Clear();
                newCombo.DataBindings.Add(new Binding("Text", bsRequill, column.ColumnName));
                newCombo.TextChanged += new EventHandler(newCombo_TextChanged);

                flpRequill.Controls.Add(newLabel);
                flpRequill.Controls.Add(newCombo);
                cnt++;
            }
        }

AnswerRe: Saving data to SQL from dynamically made comboboxes... Pin
AmitGajjar4-Jun-12 2:06
professionalAmitGajjar4-Jun-12 2:06 
GeneralRe: Saving data to SQL from dynamically made comboboxes... Pin
Vidor4-Jun-12 5:00
professionalVidor4-Jun-12 5:00 
GeneralRe: Saving data to SQL from dynamically made comboboxes... Pin
AmitGajjar4-Jun-12 17:55
professionalAmitGajjar4-Jun-12 17:55 
SuggestionRe: Saving data to SQL from dynamically made comboboxes... Pin
Paul Conrad4-Jun-12 17:07
professionalPaul Conrad4-Jun-12 17:07 
Questiondatabinding in the constuctor not working properly Pin
matleeds3-Jun-12 22:02
matleeds3-Jun-12 22:02 
AnswerRe: databinding in the constuctor not working properly Pin
matleeds3-Jun-12 22:57
matleeds3-Jun-12 22:57 
GeneralRe: databinding in the constuctor not working properly Pin
Luc Pattyn4-Jun-12 4:18
sitebuilderLuc Pattyn4-Jun-12 4:18 
AnswerRe: databinding in the constuctor not working properly Pin
mallikharjuna2214-Jun-12 21:20
mallikharjuna2214-Jun-12 21:20 
QuestionC# 2010 edit Pin
dcof3-Jun-12 18:08
dcof3-Jun-12 18:08 
AnswerRe: C# 2010 edit Pin
Richard MacCutchan3-Jun-12 22:09
mveRichard MacCutchan3-Jun-12 22:09 
AnswerRe: C# 2010 edit Pin
Eddy Vluggen4-Jun-12 3:30
professionalEddy Vluggen4-Jun-12 3:30 
Questionc# DataGridView EditMode and DeleteKey Pin
blissMaster3-Jun-12 15:25
blissMaster3-Jun-12 15:25 
AnswerRe: c# DataGridView EditMode and DeleteKey Pin
Abhinav S3-Jun-12 17:16
Abhinav S3-Jun-12 17:16 
Questionconvert part of a list to an array Pin
a.fatemeh3-Jun-12 7:18
a.fatemeh3-Jun-12 7:18 
AnswerRe: convert part of a list to an array Pin
Dave Kreskowiak3-Jun-12 7:30
mveDave Kreskowiak3-Jun-12 7:30 
GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 7:56
VJ Reddy3-Jun-12 7:56 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 8:59
sitebuilderLuc Pattyn3-Jun-12 8:59 

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.