none
how to get the data from datagridview to textboxes in c#.net

    Question

  •  i was inserted 5 rows of  data into grid view and also  in one number into text box on windows form i need to 

    store the data in dataset with combination of that text box data and 5 rows data in dataset in below example

    we need 

                          po123 for all 5 rows in result set

     

     

    • Moved by Paul Zhou Thursday, December 29, 2011 5:53 AM move for better support (From:.NET Base Class Library)
    Tuesday, December 27, 2011 6:26 PM

All replies

  • hi ,

    can you specify more?

    how can we get "po123"? is it from db or customer specify?

     


    By Sanz If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Wednesday, December 28, 2011 11:10 AM
  • If this is a dataset, use query in dataset. Ex:

    ds.Select("PurchaseOrder='" + txtPONo.Text + "'")

    Where ds = the dataset, PurchaseOrder = The column name in your dataset/database

    Thanks


    Anirban Bhattacharya (Lead Consultant - ESSPL)
    Wednesday, December 28, 2011 11:42 AM
  • Also this will return DataRow list. If you need the result in another datatable then...

    DataTable dt = (ds.Select("PurchaseOrder='" + txtPONo.Text + "'")).CopyToDataTable

    Thanks


    Anirban Bhattacharya (Lead Consultant - ESSPL)
    Wednesday, December 28, 2011 11:43 AM
  • I'm moving this thread to Windows Forms Data Controls and Databinding forum to get better support.

    Moreover, what do you mean "store the data in dataset with combination of that text box data and 5 rows data in dataset"?

    Could you please describe your purpose in more details?

    Have a nice day.

     


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Thursday, December 29, 2011 5:52 AM
  • Hi chakramurthi,

    Welcome to the MSDN Forum.

    After I read your quesitons, I can not understand that what do you want to save to DataSet and where do you want to put into the DataGridView especially the "PO123"?

    I guess the Sr.No is an identity column, but where do you want to put the PO123 to the DataGridView/save to the DataSet?

    Could you please carify your requirement and show more detailed information so that we can understand your questions and we can support for you!

    Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us
    Friday, December 30, 2011 7:10 AM
  • Hi,

    I asked that only he hasn't replied might be he has resolved the problem


    By Sanz If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, December 30, 2011 5:31 PM