Ok, I understand that, but you are missing links on the line. Where does the error occur?
Line 30: sUsername.Trim(); Line 31: sPassword.Trim(); Line 32: string ConnectionString = WebConfigurationManager.ConnectionStrings["dbnameConnectionString"].ConnectionString; Line 33: SqlConnection myConnection = new SqlConnection(ConnectionString); Line 34: try
if I assume sPassword exists - and sUsername ... ... then does the web.config ConnectionString "dbNameConnectionString" exist? If not, then null, and ".ConnectionString" naturally throws this error.
source share