Select string as a column name in datatable?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have problem using the string I declared in selecting the column in my
datatable.
Please could you tell me am I doing something incorrect?
Here is my code:

Dim myString As String

Dim dv As DataView = New DataView(dsDataSet.Tables("myTable"), _
" '" & myString & "' = '" & otherString & "'", "",
DataViewRowState.CurrentRows)

It compiles without problem,
but when I run it, It returns nothing from my dataview.

Can anyone help please, many thanks
 
Jonhathan,

Although I often make instructions where other would use more lines, I never
do that with the dataview. Splitsing it up in three lines makes that much
less error sensitive.

dim dv as new dataview(mytable)
dv.sort = "mysort"
dv.rowfilter = "mysort = 1"

I hope this helps?

Cor
 

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