Static member initialization exception this is the connection to the database

private static string connStr = ConfigurationManager.ConnectionStrings ["data"] .ConnectionString;

what does that mean? I don"t understand. I"m going to connect to the database and winform

. What is

["data"]

copy it from a blogger.

Mar.22,2021

private static string connStr =ConfigurationManager.ConnectionStrings["data"].ConnectionString;

this is the string that links the database

["data"] to connect ConnectionStrings ["data"] look at it this way

get the data named data field


this is the connection string in app.config. App.config has multiple connection strings. This data means to find the connection string whose key is "data".

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea18ab-4f034.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea18ab-4f034.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?