PC Review


Reply
Thread Tools Rate Thread

dataviews/sets

 
 
Jon
Guest
Posts: n/a
 
      11th Jan 2005
I have the following SQL, which I want to put into a dataset. Later, I
want to be able to select a portion of the dataset, based on say the
regionnumber or the regionnumber and divisionnumber. I was reading up
on datasets and views and I'm a bit confused exactly how to go about
doing this. Can someone point me in the right direction or show a code
sample that does what I'm after? I'd appreciate it! Thanks

select
sr.regionnumber,
replace(sr.description,'""','') regiondescr,
sd.divisionnumber,
replace(sd.description,'""','') divdescr,
sdist.districtnumber,
replace(sdist.description,'""','') distdescr,
cs.customersitenumber,
replace(cs.name,'""','') sitename
from
salesregion sr, salesdivision sd,salesdistrict sdist, customersite cs
where sd.regionnumber=sr.regionnumber
and sdist.regionnumber=sd.regionnumber
and sdist.divisionnumber=sd.divisionnumber
and cs.regionnumber=sdist.regionnumber
and cs.divisionnumber=sdist.divisionnumber
and cs.districtnumber=sdist.districtnumber
and sr.dateclosed is null
and sd.dateclosed is null
and sdist.dateclosed is null
and cs.datepermclosed is null
order by sr.description, sd.description, sdist.description, cs.name
 
Reply With Quote
 
 
 
 
Ritesh Jain via DotNetMonster.com
Guest
Posts: n/a
 
      11th Jan 2005
Hi,
U can First Fill the Dataset as per the Query into Datatable say dtTable

Then Whenever u want to filter out the Records just .......

dtTable.DefaultView.RowFilter =""
dtTable.DefaultView.RowFilter = " regionnumber = " & RegNo & " AND divisionnumber = " & dicNo

then u can Refer to DataRowView to work with Filtered Records..........

Regards,
Ritesh

--
Message posted via http://www.dotnetmonster.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel graph 3 sets of data. 2 sets as lines 1 as column? AndyN Microsoft Excel Charting 2 11th Jul 2008 01:18 PM
Word 2007 Style Sets - Why does some formatting stay between sets? pmsimp Microsoft Word Document Management 0 21st Apr 2008 07:57 PM
Dataviews mfleet1973@yahoo.ca Microsoft VB .NET 1 10th Jul 2006 03:37 PM
DataViews Eric B Microsoft C# .NET 1 28th May 2006 03:10 PM
New to DataViews =?Utf-8?B?Tm92aWNl?= Microsoft ADO .NET 0 25th May 2004 10:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 PM.