.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Count the null values

Posted By: Catherine     Posted Date: September 27, 2011    Points:5   Category :ASP.Net
Hi how to count the null values in vb.net. Even if that particular branch not having anything

for example

branch name count
chennai 10

trichy 0

Author: Narayanan             
Posted Date: September 27, 2011     Points: 20   

Information retrieve from database.if "Yes" use select Count(col name) from tbl_name or please explain your project .

Regards, Lakshmi Naraayanan.S
Author: Ravi Ranjan Kumar             
Posted Date: September 27, 2011     Points: 20   

hey! Catherine if you'r query related to Database and you want to sum values based on Null.
then have a look at given link
In addition you can also use Compute function to accomplish your task.
DataTable.Compute("AggregateFunction(DataColumn)", "condition|Nothing|null")

how to use Compute. take a look there-[http://msdn.microsoft.com/en-us/library/system.data.datatable.compute.aspx]

if you have any query then feel free to revert back

Thanks & Regards
Ravi Ranjan Kumar
Author: Catherine             
Posted Date: September 28, 2011     Points: 20   

Hi,employee table contains employee details. when i select the employee id the result should be number of works done by employees. If i select E101 the count is 5. and i select ID not in that particular table the output should be 0. For example. Please

Emp_Id count

E101 5
E1000 0

Author: kamlesh             
Posted Date: September 30, 2011     Points: 20   

check this



Thanks And Regards.
Kamlesh Nikam
Author: Syed Shakeer Hussain             
Posted Date: October 12, 2011     Points: 20   

Hi catherine,

use the below query

SELECT COUNT(*) FROM TableName WHERE Emp_Id='passingValue'

eg:SELECT COUNT(*) FROM TableName WHERE Emp_Id='E1000'

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend