CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> .NET

 Count the number of rows added to the database.

Print topic Send  topic

Author Message

Posts: 49
Posted: 11/03/2008, 3:09 PM

How do I count the number of rows I added to my database? I'm have trouble compiling in CodeCharge. For some reason Console.WriteLine() method has no effect.


I was thinking I could do the following:

string connectionString = GetConnectionString();  
using (SqlConnection sourceConnection = new SqlConnection(connectionString))  
SqlCommand commandRowCount = new SqlCommand(  
"SELECT COUNT(*) FROM Employees;", sourceConnection);  
long countStart = System.Convert.ToInt32(  
Console.WriteLine("Starting row count = {0}", countStart);  
long countEnd = System.Convert.ToInt32(  
Console.WriteLine("Ending row count = {0}", countEnd);  
Console.WriteLine("{0} rows were added.", countEnd - countStart);  
O:) O:)
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.