Question : How to get the database record count in MS SQL Server 2005?

I have an aspx web page that I use privately to return records from a Microsoft SQL Server 2005 database file. The page works great. It allows me to view and pretty-print the records, which is just what I want. There is one annoying thing however. If the database is empty, the page loads with a NullReferenceException. I was wondering if there was Visual Basic code I could use to test the database for a zero record count to avoid this error. My old Delphi Borland Database Engine had a MyTable.RecordCount property that could be checked. I don’t see that the ASP.Net SQLDataSource component has a similar property that can be read. How or can this be done?

Answer : How to get the database record count in MS SQL Server 2005?

Yes, you can connect with SQL Developer.

First, you make sure that tnsnames.ora which was setup when you installed oracle, is configured to point to the instance of your oracle database.

It looks something like this:

# TNSNAMES.ORA Network Configuration File: C:\oracle\product\9i\OEM\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ACS.Mydoamin.us =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ACSProduction or whatever)
    )
  )

Then on SQL Developer, you see connections to the top left corner of SQL Developer once it is launced.

Right-click on connections.

on Connection Name: give it any name.

Username: Scott or your username
Password: Tiger or your password

Choose TNS as your connection Type

Select the Network Alias radio button and give it the name you find in your tnsnames.ora and baring any mistakes, it should connect you.

You can also use SQL Plus to do so.

Hope this helps.
Random Solutions  
 
programming4us programming4us