Take values from a Datagrid Row to a variable.

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

This must be easy, but I can't find a way to do it. I have a datagrid
displaying Rows from a Datatable. I want to take the values in the Row and
ultimately use them in a SQL Where string. I would like to take the values
and enter them into a String Variable, but can't find a good way to do this
with more than 1 value..

Help!!

Thanks,
Shawn
 
Thanks for the reply. I know how to get the values from the datagrid, the
problem I am having is getting the values into a single string variable.

Ex: If I have a Datagrid with 1 column and 3 rows..
Row1 = "Test1"
Row2 = "Test2"
Row3 = "Test3"

I create a variable as Dim vbString As String.

Now I want that variable to equal "Test1, Test2, Test3"

Shawn
 
Check out the StringBuilder class in Help. And look at the .Append method. There is a good example there that should give you
an idea on how to use it.
james
 
That looks perfect. Exactly what I am looking for!! Thanks.

james said:
Check out the StringBuilder class in Help. And look at the .Append
method. There is a good example there that should give you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top