The error message tells you that
SqlConnection.ConnectionString Property (System.Data.SqlClient) | Microsoft Docs[
^] has not been initialized.
The problem most probably lies into the
ConnD()
method, the content of which you forgot to show. Moreover you seem to have two variables for the connection:
con
and
conn
; which is the proper one? It would also be useful to know where the
conn
or
con
variable has been declared and initialized.