Ask a Question related to ASP.NET General, Design and Development.
-
Chris Wilmot #1
Re: count rows in dataset...
Try
MyDataset.Tables(0).Rows.Count
Chris Wilmot
"John Pether" <john@<nospam>dotnetsites.net> wrote in message
news:ORC$H6cUDHA.2284@TK2MSFTNGP12.phx.gbl...
links.GetLinks> I have the following code which loads a dataset into a datagrid:
> <code>
> ' Obtain Link information from Links table
> ' and bind to the datagrid control
>
> Dim links As New DNSite.LinksIndexDB()
>
> ' DataBind Links to DataGrid Control
>
> DG.DataSource = links.GetLinks(CatID)
> DG.DataBind()
> DLLegend.DataSource = links.GetGroups
> DLLegend.DataBind()
> TotalLinks =
> </code>
>
> TotalLinks needs to be the number of rows of data from the datasetASP.NET resources...>
> Can anyone tell me how I access that info?
>
> thx:)
>
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Chris Wilmot Guest
-
rows count
Move the resultset to an array using getRows, and then use ubound. See http://www.aspfaq.com/2193 and http://www.aspfaq.com/2467 ... -
Count excel Rows
I have an application need to read excel file and count the rows in the page, but not quite sure how to approach. Anyone have any suggestions? ... -
Total Rows and count of specific instance in one read
Is it possible to get the total number of rows and specify where clause in the same stored procedure. For instance, I am trying to get the the... -
BUG in DataBind? After .DataBind there are more DataGrid Items than DataSet Rows!
Consider: Private Sub BindData(ByRef objDataSet As DataSet) Dim x% = DataGrid_Report.Items.Count() Dim y% = objDataSet.Tables(0).Rows.Count() '... -
[PHP] count rows
Help me out here. I want to get a numeral on the number of records in a table. What is the function? ... -
John Pether (john@ #2
count rows in dataset...
I have the following code which loads a dataset into a datagrid:
<code>
' Obtain Link information from Links table
' and bind to the datagrid control
Dim links As New DNSite.LinksIndexDB()
' DataBind Links to DataGrid Control
DG.DataSource = links.GetLinks(CatID)
DG.DataBind()
DLLegend.DataSource = links.GetGroups
DLLegend.DataBind()
TotalLinks =
</code>
TotalLinks needs to be the number of rows of data from the dataset links.GetLinks
Can anyone tell me how I access that info?
thx:)
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
John Pether (john@ Guest
-
Saravana #3
Re: count rows in dataset...
Before binding your datasource with datagrid, load it in local dataset and
then find out the count. For example,
Dataset1 = links.GetLinks(CatID)
Dataset1.tables(0).rows.count
DG.DataSource= DataSet1
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"John Pether" <john@<nospam>dotnetsites.net> wrote in message
news:ORC$H6cUDHA.2284@TK2MSFTNGP12.phx.gbl...links.GetLinks> I have the following code which loads a dataset into a datagrid:
> <code>
> ' Obtain Link information from Links table
> ' and bind to the datagrid control
>
> Dim links As New DNSite.LinksIndexDB()
>
> ' DataBind Links to DataGrid Control
>
> DG.DataSource = links.GetLinks(CatID)
> DG.DataBind()
> DLLegend.DataSource = links.GetGroups
> DLLegend.DataBind()
> TotalLinks =
> </code>
>
> TotalLinks needs to be the number of rows of data from the datasetASP.NET resources...>
> Can anyone tell me how I access that info?
>
> thx:)
>
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Saravana Guest
-
John Pether (john@ #4
Re: count rows in dataset...
ok, so i wasn't able to do that in the code behind but I can do it in the function from the data access class file, see code below
So I have created a Dim TotalLinks and filled it but how do I access that from my page behind code??? any ideas?
<code>
Public Function GetLinks(ByVal CatID As Long) As DataSet
Dim myConnection As New SqlConnection(strConnection)
' Create Instance of Connection and Command Object
Dim myCommand As New SqlCommand("GetLinks", myConnection)
' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure
' Add Parameters to SPROC
Dim parameterCatID As New SqlParameter("@CatID", SqlDbType.BigInt)
parameterCatID.Value = CatID
myCommand.Parameters.Add(parameterCatID)
'********ADDED*********
Dim TotalLinks As Long
TotalLinks = GetLinks.Tables(0).Rows.Count
'********ADDED*********
' Execute the command
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Function
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
John Pether (john@ Guest



Reply With Quote

