0

I have a winforms app in C# in with a user is prompted to select from a range of items, the items are displayed in a listview with the checkboxes set to true. After the user selects one item i want the description and a value from an SQL database to be displayed in another form, in 2 textboxes. Is there a way to accomplish this? I think it would be something like:

  private void button1_Click(object sender, EventArgs e)
    {
        If(listView1.SelectedItems = ??); 
        {
            "select[descri] + '  ' + [compo] from vidros" 
             pass it to form "build" in textbox "desc2"           
            "select valu from vidros" 
             pass it to form "build" in textbox "tt"
             this.close();
        }
        else
        {
            MessageBox.Show("Please select an item!", "Warning!");
        }
    }
0

1 Answer 1

1

it is possible. And all the answers are here on StackOverflow:

After the user selects one item

Get single listView SelectedItem

"select[descri] + ' ' + [compo] from vidros"

How to retrieve data from a SQL Server database in C#?

pass it to form "build" in textbox "desc2"

Send values from one form to another form

I wish you success constructing all this information into working code :)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, ill surely try :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.