To get the Record Count or Row Count returned by SQLDataSource control, we have to use DataSourceSelectArgument class.
Create an object to the DataSourceSelectArgument class, set its RetrieveTotalRowCount property to true and by using a DataView we can retrieve the Row Count of the SQLDataSource object. The sample block of code is given below. Try it.
<pre name="code" class="CSharp">
DataSourceSelectArguments dssa = new DataSourceSelectArguments();
dssa.RetrieveTotalRowCount = true;
DataView dv = (DataView)SqlDataSource1.Select(dssa);
Response.Write("No of Records : " + dv.Table.Rows.Count);
BEGIN TRY BEGIN TRAN --put queries here COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT>0 BEGIN SELECT @@ERROR,ERRO...
Here are some of the string formats that you can try out: Specifier type output (June 8, 1970 12:30:59) dd Day 08 ddd ...
One of my friends contacted me recently and said they needed some help creating a stored procedure that imported data from a text file. They...
How to find the all child of particular parent using the Recursive Query --here we are creating the table variable so that we can insert so...