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


Top 5 Contributors of the Month
david stephan

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

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

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


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
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
http://www.bennadel.com/blog/579-SQL-COUNT-NULLIF-Is-Totally-Awesome.htm
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
http://raviranjankr.wordpress.com
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

http://stackoverflow.com/questions/378225/how-to-check-for-null-value-in-vb-net
http://stackoverflow.com/questions/2647558/preserving-null-values-in-a-double-variable
http://social.msdn.microsoft.com/Forums/pl-PL/vbide/thread/410d106b-8a78-4bfd-bb2f-ee25c22ec950

http://www.devblog.com/2007/11/nothing-and-null-in-vbnet.html

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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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