If you are "always getting struck" by the same error, then it's probably time you stopped doing that...
Look at your code:
Database dblogin = null;
DbConnection dbconn = null;
DbCommand lgncmd;
string Sp_login = string.Empty;
string Str_Details = string.Empty;
try
{
if (dbconn.State == ConnectionState.Closed)
You create a variable to reference a DbConnection (dbconn), and you set it to null.
The next time you use it, you try to access a property. So the system looks at it, and sees it is null - i.e. has no instance - and rightly throws an exception.
You need to create an instance of your DbConnection class, and assign it to dbconn before you can use it. Probably, along the lines of this:
DbConnection dbconn = new DbConnection();
If you think of cars instead of variables, a parking space is a place to store an instance of a car: but you can't drive away while the space is empty, because it doesn't have a car in it to drive! You have to go to a parking space that contains a car (preferably yours) before you can drive off.