Add a reference. System Configuration
Configurationmanager.appsettings[""]
<appSetings>
<add key= "" Value= "" >
</appSetings>
<connectionStrings>
<add key= "" connectionstring= "" >
</connectionString>
Configurationmanager.connecsring[""]. ConnectionString
Excutescalar ();
SqlDataReader Reader=excutereader (); Reader pointer, pointing to table header
Reader. Read ();
producer Consumer problems --The connection pool of SQL connection
Httoapplication —————— Object Pooling Technology
add config file inside app.
while (reader. Read ())
{
}
String constr=configurationmanage.connectionstrings[].connectionstring;
String Filename=string.empty;
using (SaveFileDialog std=new SaveFileDialog ())
{
Filename=std. Filename;
}
StreamWriter writer=new StreamWriter (filename)
Writer. WriteLine ("")
Reader. HasRows//reader a property: Determine if data is included, return bool type
Reader always occupies the Sqlconnectiion object,
If you re-execute cmd.commandtext you have to wait until reader releases just connection object
DateTime.now.substract ()
SQL Prevention Injection:
Cmd. Parameters.Add ("@username", txtUsername.Text)
C # Configuration issues and simple prevention of SQL injection, connection pooling issues, SqlDataReader object release for connection objects