Using system. IO;
Using system. runtime. serialization. formatters. Binary;
Hashtable AA = new hashtable ();
Private void buttonsave_click (Object sender, eventargs E)
{
Filestream FS = new filestream ("E: \ 400tel. dat", filemode. Create );
Binaryformatter BF = new binaryformatter ();
BF. serialize (FS, AA );
FS. Close ();
}
Private void buttonload_click (Object sender, eventargs E)
{
AA. Clear ();
Filestream FS = new filestream ("E: \ 400tel. dat", filemode. openorcreate );
Binaryformatter BF = new binaryformatter ();
AA = (hashtable) BF. deserialize (FS );
FS. Close ();
}
// Dictionary <string, string> DIC = new dictionary <string, string> (13000000 );
C # connect to the MySQL database
String connectionstring = "Server = localhost; user id = xxxx; Password = xxxx; database = XXXX ";
String sqlstring = "... (the SQL statement is omitted here )";
Using (mysqlconnection connection = new mysqlconnection (connectionstring ))
{
Using (mysqlcommand cmd = new mysqlcommand (sqlstring, connection ))
{
Try
{
Connection. open ();
Int rows = cmd. executenonquery (); // execute an SQL statement
Return rows;
}
Catch (MySQL. Data. mysqlclient. mysqlexception E)
{
Connection. Close ();
Throw E;
}
}
}
Download
Mysql-connector-net-6.4.3.rar
Download mysql-connector-net-6.4.3-src.zip