Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Extract data from a adapter into a view with a string field


Message #1 by robwildi@d... on Mon, 2 Sep 2002 21:09:05
HI
I tried to extract a subset of data from a data adapter into a view. The 
selection takes place via a ComboBox (cmbValor) into a string field 
(test).
I found a example in a Wrox book: ADO.NET Programmer's Reference on page 
817-818 witch looks like that:

dsDataView.RowFilter = "Country Like '" & strCountry & "*'". 

In my example it looks like that:

test = cmbValor.Text.ToString  

SelPos = New DataView(dsPortfolio.Tables("tabPositionDetail"))

SelPos.RowFilter = "wdValorenNr = '" & test & "'"  ==> if it is a string 
field it produces always 1 record.

if I use: SelPos.RowFilter = "wdValorenNr =  '278848'"   ===>  if it is a 
constant it works, but it isn't what I wont.


Have someone a good example?


Many thanks of helping me.

Regards

Robert
Message #2 by "Brian Smith" <bsmith@l...> on Tue, 3 Sep 2002 11:29:34 +0100
Robert,
No reason that shouldn't work - I suugest you check the actual value of
RowFilter in the debugger. The value you are assigning to test may be
incorrect - you don't need the ToString
i.e. test = cmbValor.Text  will suffice.

brian

-----Original Message-----
From: robwildi@d... [mailto:robwildi@d...] 
Sent: Mon, 02 September 2002 21:09
To: ADO.NET
Subject: [ado_dotnet] Extract data from a adapter into a view with a
string field


HI
I tried to extract a subset of data from a data adapter into a view. The

selection takes place via a ComboBox (cmbValor) into a string field 
(test).
I found a example in a Wrox book: ADO.NET Programmer's Reference on page

817-818 witch looks like that:

dsDataView.RowFilter = "Country Like '" & strCountry & "*'". 

In my example it looks like that:

test = cmbValor.Text.ToString  

SelPos = New DataView(dsPortfolio.Tables("tabPositionDetail"))

SelPos.RowFilter = "wdValorenNr = '" & test & "'"  ==> if it is a string

field it produces always 1 record.

if I use: SelPos.RowFilter = "wdValorenNr =  '278848'"   ===>  if it is
a 
constant it works, but it isn't what I wont.


Have someone a good example?


Many thanks of helping me.

Regards

Robert
---
ASP.NET Distributed Data Applications
This book will inspire you with a range of ideas on how data 
can be used to drive Web applications, and how that data can 
be most effectively utilized at each level of the design. 
Inefficient data use leads to the sort of slow, unresponsive 
Web applications that nobody enjoys using. By making good use 
of both server and client-side code, we can solve these 
problems. This book will arm you with the techniques you need 
to build Web applications that fly.
http://www.wrox.com/ACON11.asp?ISBN=1861004923


  Return to Index