473,738 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter Column in DataSet

I'll try to explain in detail what it is I'm struggling
with. I created a SQL database with one table called
CallSheet which contains the following columns:

Caller ID: <--Primary Key, auto indexed by my SQL server
From:
Company:
Status:
Date:
Phone Primary:
Phone Secondary:
Completed: <--boolean

here is the Select statement being used my my
sqldataadapter:

Select *
from CallSheet
Where completed = false

I used the where clause to try to keep from pulling down
the entire database everytime it loaded the dataset. So
at this point, I have a dataset loaded using the fill
method that displays all columns. And that's not too
bad, but there are few things that are bugging me that I
can't seem to figure out how to fix(listed by priority):

1) When the application runs, people don't need to see
the Caller ID or Completed columns. How can I filter
which columns are displayed in the dataset during runtime?

2) How can I set the column width for each of the columns
in the dataset? I realize that during runtime I can
modify them via dragging, but I would like to be able to
save people from having to do that. Anybody got any
ideas?

3) Ok, one other thing..how can I print the actual
dataset? Not the windows form, I need to output the
dataset for printing somehow, lots of documentation talks
about printing text files and such..but no one talks
about printing from datasets.

Any ideas would be appreciated, this is my first
application with Visual Basic .net, just trying to get my
feet wet.

Thanks a ton

Jason
Nov 20 '05 #1
3 7893
Hi Jason,

Answer to the first question:

select from, company, status, ddate, phonep, phones from callsheet where
completed = false

Note that you don't have to have completed in the column list and can still
call it in the where clause. Also, the order of columns is completely up to
you.

2nd q - setting the column width suggests you are in a datagrid, right? I
use the component one grid so much that I don't remember how to set widths,
but look at the object model - it has to be simple to do.

3rd q - to print the dataset, use the crystal report viewer/designer (which
comes with vs .net).

HTH,

Bernie Yaeger
"jason" <Ja**********@p raxis.com> wrote in message
news:04******** *************** *****@phx.gbl.. .
I'll try to explain in detail what it is I'm struggling
with. I created a SQL database with one table called
CallSheet which contains the following columns:

Caller ID: <--Primary Key, auto indexed by my SQL server
From:
Company:
Status:
Date:
Phone Primary:
Phone Secondary:
Completed: <--boolean

here is the Select statement being used my my
sqldataadapter:

Select *
from CallSheet
Where completed = false

I used the where clause to try to keep from pulling down
the entire database everytime it loaded the dataset. So
at this point, I have a dataset loaded using the fill
method that displays all columns. And that's not too
bad, but there are few things that are bugging me that I
can't seem to figure out how to fix(listed by priority):

1) When the application runs, people don't need to see
the Caller ID or Completed columns. How can I filter
which columns are displayed in the dataset during runtime?

2) How can I set the column width for each of the columns
in the dataset? I realize that during runtime I can
modify them via dragging, but I would like to be able to
save people from having to do that. Anybody got any
ideas?

3) Ok, one other thing..how can I print the actual
dataset? Not the windows form, I need to output the
dataset for printing somehow, lots of documentation talks
about printing text files and such..but no one talks
about printing from datasets.

Any ideas would be appreciated, this is my first
application with Visual Basic .net, just trying to get my
feet wet.

Thanks a ton

Jason

Nov 20 '05 #2
-----Original Message-----
Hi Jason,

Answer to the first question:

select from, company, status, ddate, phonep, phones from callsheet wherecompleted = false

Note that you don't have to have completed in the column list and can stillcall it in the where clause. Also, the order of columns is completely up toyou.
You are correct, but I need to be able to modify the
completed column. How can I modify it unless it's a part
of my dataset? I want it to be there, that way I can
continue to use a datarow variable to set it when users
use the application? Do you know a way that I can modify
that variable without having to have it in a dataset?


2nd q - setting the column width suggests you are in a datagrid, right? Iuse the component one grid so much that I don't remember how to set widths,but look at the object model - it has to be simple to do.

The component one grid? I don't suppose you have a link
for that somewhere, I'd love to find something other than
a dataset. (of course, if I wasn't so green, I might do a
little better at it)
3rd q - to print the dataset, use the crystal report viewer/designer (whichcomes with vs .net).
Doesn't that mean I would have to put crystal reports on
every machine?? I thought crystal reports was more for
the developer, not the end users using the application.
Or is that wrong?
HTH,

Bernie Yaeger
"jason" <Ja**********@p raxis.com> wrote in message
news:04******* *************** ******@phx.gbl. ..
I'll try to explain in detail what it is I'm struggling
with. I created a SQL database with one table called
CallSheet which contains the following columns:

Caller ID: <--Primary Key, auto indexed by my SQL server From:
Company:
Status:
Date:
Phone Primary:
Phone Secondary:
Completed: <--boolean

here is the Select statement being used my my
sqldataadapter:

Select *
from CallSheet
Where completed = false

I used the where clause to try to keep from pulling down the entire database everytime it loaded the dataset. So at this point, I have a dataset loaded using the fill
method that displays all columns. And that's not too
bad, but there are few things that are bugging me that I can't seem to figure out how to fix(listed by priority):
1) When the application runs, people don't need to see
the Caller ID or Completed columns. How can I filter
which columns are displayed in the dataset during runtime?
2) How can I set the column width for each of the columns in the dataset? I realize that during runtime I can
modify them via dragging, but I would like to be able to save people from having to do that. Anybody got any
ideas?

3) Ok, one other thing..how can I print the actual
dataset? Not the windows form, I need to output the
dataset for printing somehow, lots of documentation talks about printing text files and such..but no one talks
about printing from datasets.

Any ideas would be appreciated, this is my first
application with Visual Basic .net, just trying to get my feet wet.

Thanks a ton

Jason

.

Nov 20 '05 #3
Hi Jason,

In order to modify a column that is not in a datatable (which is the table
or tables inside a dataset), you would have to write a stored procedure
which refers to that column even though it isn't in the datatable that is
available to the end user. More simply, you could include the column but
hide it (by setting its visible property to false) inside the datagrid
wherein it is being displayed.

The MS datagrid is fine, to my recollection, but the Component One grid is
much more flexible and performs magnificently. You can learn more about it
at www.componentone.com. There are many, many other 3rd party .net grids,
and many of them look to be very useful as well, so you should look at
others as well. If you enter '.net datagrid' in google, you should be able
to begin reviewing several of these. They're all pretty expensive, but most
come with a suite of other useful controls - costs range from about $300 to
$800 or so (which includes all of the controls).

No, you would not have to deploy crystal on all of the pc's that use the
app. You would simply have to have a setup routine that installs the
necessary .dlls. Crystal has tutorials on how to do this - it's not
exceptionally difficult. You might begin by going to
www.crystaldecisions.com for some guidance. But think about it, Jason.
You'll have to build more and more sophisticated reports as time goes by -
you're not going to get anywhere, practically speaking, without a useful
report writer. And of course the end user doesn't interact with CR - they
simply perform the appropriate button click and your code executes the
report.

HTH,

Bernie

"Jason" <ja**********@p raxis.com> wrote in message
news:0d******** *************** *****@phx.gbl.. .
-----Original Message-----
Hi Jason,

Answer to the first question:

select from, company, status, ddate, phonep, phones from

callsheet where
completed = false

Note that you don't have to have completed in the column

list and can still
call it in the where clause. Also, the order of columns

is completely up to
you.


You are correct, but I need to be able to modify the
completed column. How can I modify it unless it's a part
of my dataset? I want it to be there, that way I can
continue to use a datarow variable to set it when users
use the application? Do you know a way that I can modify
that variable without having to have it in a dataset?


2nd q - setting the column width suggests you are in a

datagrid, right? I
use the component one grid so much that I don't remember

how to set widths,
but look at the object model - it has to be simple to do.


The component one grid? I don't suppose you have a link
for that somewhere, I'd love to find something other than
a dataset. (of course, if I wasn't so green, I might do a
little better at it)
3rd q - to print the dataset, use the crystal report

viewer/designer (which
comes with vs .net).


Doesn't that mean I would have to put crystal reports on
every machine?? I thought crystal reports was more for
the developer, not the end users using the application.
Or is that wrong?

HTH,

Bernie Yaeger
"jason" <Ja**********@p raxis.com> wrote in message
news:04******* *************** ******@phx.gbl. ..
I'll try to explain in detail what it is I'm struggling
with. I created a SQL database with one table called
CallSheet which contains the following columns:

Caller ID: <--Primary Key, auto indexed by my SQL server From:
Company:
Status:
Date:
Phone Primary:
Phone Secondary:
Completed: <--boolean

here is the Select statement being used my my
sqldataadapter:

Select *
from CallSheet
Where completed = false

I used the where clause to try to keep from pulling down the entire database everytime it loaded the dataset. So at this point, I have a dataset loaded using the fill
method that displays all columns. And that's not too
bad, but there are few things that are bugging me that I can't seem to figure out how to fix(listed by priority):
1) When the application runs, people don't need to see
the Caller ID or Completed columns. How can I filter
which columns are displayed in the dataset during runtime?
2) How can I set the column width for each of the columns in the dataset? I realize that during runtime I can
modify them via dragging, but I would like to be able to save people from having to do that. Anybody got any
ideas?

3) Ok, one other thing..how can I print the actual
dataset? Not the windows form, I need to output the
dataset for printing somehow, lots of documentation talks about printing text files and such..but no one talks
about printing from datasets.

Any ideas would be appreciated, this is my first
application with Visual Basic .net, just trying to get my feet wet.

Thanks a ton

Jason

.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6614
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where the text value is on a different table. The me.filter is then a text instead of the id-number from the lookup table. This causes the report to prompt for the parameter. How do I get by this problem? Do I need to create a temporary table? I rather...
4
15178
by: Hardy Wang | last post by:
Hi all: I have a DataSet populated with values. How can I return ds.Tables.DefaultView's records from a starting number to a ending number? For example, I have 100 records in the DefaultView, but I just need records from 25th to 50th. Thanks for any suggestion! --
1
8803
by: SPG | last post by:
Hi, I need to be able to filter the columns that are visible through a dataset. That is, I can have all columns in a dataset, but only some of them are visible when filtered. I know you can use rowfilter on a dataview. Is there anything like that I can use? Steve
3
2174
by: Mark | last post by:
Hi - when working with datasets, is it quicker to loop through the dataset, comparing some column values with predetermined values, or should I apply a filter on the dataset to retrieve the values I want? (background - I'm populating an appointment calendar for consultants, and need to check around 30 dates at a time dates for each of the 45 consultants - so I retrieve all appointments between the start date, and the startdate + 30 days...
2
1534
by: andrew007 | last post by:
I have a question about dataset rowfilter. I have a list of event table in a database. each event has start-date and end-date column. I grab these from db and save to dataset. And then I have to do rowfilter of dataset to filter based on user's input. Users can select the following as dropdown for filtering. - last 30 days - last 7 days - today - all pasts
4
3242
by: HAN(removethis)twister | last post by:
Is there a way to make a DataView Row Filter filter for more than one column? Thanks!
11
2148
by: Thomas A | last post by:
Hi, I fill a datgrid with data from a xml document, it works fine But.... Now I will to filter the data to the grid so only the data shows from the criteria that I set. My code now is very simple to fill the grid
2
3408
by: Brian Henry | last post by:
say i have a dataset called dv and i have a boolean value i want to filter by "b_DoesWork" while the column name in the data view that i want to filter on is called "Works" how would i filter this since the rowfilter is a string? i tried dv.rowfilter = "Works = " & b_DoesWork and get errors back in the IDE that says
3
12778
by: Uri Dimant | last post by:
Hello We use VS 2005. I fill a data table with simple data from database (one table) which has one column called 'flag' filtering by numbers as 1,2,3. Now that I have all data in data table I'd like to filter it by value in 'flag' column. I have three datagrid views on my form and would like to fill each grid with filtered data. I mean Sub FillDataGrid (dt as datatable) with Grid1
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.