473,396 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get record count from filtered datasourse (not set)

What are the steps necessary to get the filtered count from datasource. If i
have to move it into a table just to gat the count i'll do so, but i'm not
sure what the steps are needed to accomplish this.

Thanks
KES
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
Jul 6 '07 #1
3 1743
"WebBuilder451" <We***********@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
What are the steps necessary to get the filtered count from datasource. If
i
have to move it into a table just to gat the count i'll do so, but i'm not
sure what the steps are needed to accomplish this.
DataSet MyDS = <fetch DataSet>;
MyDS.Tables[0].DefaultView.RowFilter = "......";
int FilterCount = MyDS.Tables[0].DefaultView.Count;
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 6 '07 #2
thanks for replying,
I did see this (your answer specific) in another of your postings and it is
what prompted me to repost with the "(not set)". My admitted lack of
knowledge here is how to get my dataSOURCE in to the dataSET. (...<fetch
DataSet>;)

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Mark Rae [MVP]" wrote:
"WebBuilder451" <We***********@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
What are the steps necessary to get the filtered count from datasource. If
i
have to move it into a table just to gat the count i'll do so, but i'm not
sure what the steps are needed to accomplish this.

DataSet MyDS = <fetch DataSet>;
MyDS.Tables[0].DefaultView.RowFilter = "......";
int FilterCount = MyDS.Tables[0].DefaultView.Count;
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 6 '07 #3
"WebBuilder451" <We***********@discussions.microsoft.comwrote in message
news:73**********************************@microsof t.com...
thanks for replying,
I did see this (your answer specific) in another of your postings and it
is
what prompted me to repost with the "(not set)". My admitted lack of
knowledge here is how to get my dataSOURCE in to the dataSET. (...<fetch
DataSet>;)
You need to know how to create a DataSet?

Firstly, it makes a (slight) difference what RDBMS you're using but, for the
sake of argument, let's say you're using SQL Server...

You'll need to reference the System.Data namespace, and use an appropriate
connection string, something like this:

Data Source=myServerAddress;Initial Catalog=myDataBase;User
Id=myUsername;Password=myPassword;

For more specific examples, see here:
http://www.connectionstrings.com/?carrier=sqlserver2005

string strConnectionString = "<...connection string - see above...>";

using (SqlConnection objSqlConnection = new
SqlConnection(strConnectionString))
{
objSqlConnection.Open();
using (SqlCommand objSqlCommand = new SqlCommand(pstrSQL,
objSqlConnection))
{
using (SqlDataAdapter objDA = new SqlDataAdapter(objSqlCommand))
{
using (DataSet objDataSet = new DataSet())
{
objDA.Fill(objDataSet);
objSqlConnection.Close();
return (objDataSet);
}
}
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 6 '07 #4

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

Similar topics

1
by: Justin Koivisto | last post by:
I am trying to create a report that displays a name of an advertising source and count of the number of times it was hit between certain date ranges. The data is split between two different...
6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
0
by: Claire | last post by:
At the moment I am reading, realtime, upto 400 records every 250ms from a tcp connection. This batch is filtered, converted to a set of different types of record, added to an array ready for...
1
by: Greg Smith | last post by:
I would like to display the filtered record count for a datasource used to populate a gridview. I would like to change it every time the filter is changed. Is there a way to do this? Any...
6
jinalpatel
by: jinalpatel | last post by:
I am using following code for searching records. 'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter. 'Notes: 1. We tack " AND " on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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,...

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.