954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Comparing Output from a Text File and an SQL Database

I need to count the number of records in an SQL database and compare it to a text file that contains a records number. Although I know how to access a SQL database in C#, I do not know how to count the number of records, or how to access the 2nd line of the count text file which contains "number of records: #####", and I need the ##### number to compare to the total number of records in the sql database.

smilinrascal
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Total number of rows in the database or in one particular table? The rows in a table can be returned with SELECT COUNT(*) FROM table_name.
Once you have loaded a file in a stream you can use the .readLine() function to move through the file. Then just split the string appropriately to extract the number you are after

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You