below code is ok, but Label3MouseDoubleClick not work query execute and error appeare.
```
/*
 * Created by SharpDevelop.
 * User: AmindotH
 * Date: 4/8/2025
 * Time: 4:57 PM
 * 
 * 
 */
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace WinReportGenerator
{
	/// <summary>
	/// Description of MainForm.
	/// </summary>
    public partial class MainForm : Form
    {
        private string server, database , region;
        private string connectionString;
        private ToolTip toolTip;

        public MainForm()
        {
            InitializeComponent();
            checkConfigFile();
            label2.Text = "made with \u2764\uFE0F  in Bushehr";

            toolTip = new ToolTip();
            toolTip.SetToolTip(label2, "contact: <PRESIDIO_ANONYMIZED_PHONE_NUMBER>");
            label2.Click += Label2Click;
            this.KeyPreview = true; // Ensure the form captures key events
            this.KeyDown += MainForm_KeyDown; // Handle key down events
        }

        private void checkConfigFile()
        {
            string fileName = "config.txt";
            if (!File.Exists(fileName) || new FileInfo(fileName).Length == 0)
            {
                MessageBox.Show("فایل کانفیگ یافت نشد.");
                Environment.Exit(0);
            }

            var config = new Dictionary<string, string>();
            foreach (var line in File.ReadAllLines(fileName))
            {
                var parts = line.Split('=');
                if (parts.Length == 2)
                {
                    config[parts[0].Trim()] = parts[1].Trim();
                }
            }

            if (config.TryGetValue("server", out server) && config.TryGetValue("Region", out region))
            {
                database = "Region100" + region;

                // Whitelist of allowed regions
                string[] allowedRegions = { "5100", "5101", "5104", "5106", "5107", "5109", "5112", "5116", "5119", "5122", "5125", "5128", "5131", "5132", "5134", "5135", "5137", "5139", "5141" };

                if (Array.IndexOf(allowedRegions, region) != -1)
                {
                    connectionString = "Data Source=" + server + ";Initial Catalog=" + database + ";User ID=salary;Password=salary";
                }
                else
                {
                    MessageBox.Show("Invalid region configuration!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Environment.Exit(0);
                }
            }
            else
            {
                MessageBox.Show("Invalid configuration file format!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(0);
            }
        }

        private void MainFormLoad(object sender, EventArgs e)
        {
            // ExecuteQueriesAndExportToCSV();
        }

        private void ExecuteQueriesAndExportToCSV()
        {
            string query1 = @"
                SELECT MP.EmpID As 'پرسنلی', MP.IsarCode As 'کد ایثارگری', i.Description AS 'شرح ایثارگری',
                       MP.IsarRelationCode As 'نسبت با ایثارگر', ir.Description AS 'شرح نسبت ایثارگری' 
                FROM MastPays MP
                JOIN SumCurrentValues cv ON MP.EmpID = cv.EmpID AND cv.YearMonth=MP.YearMonth AND cv.SerialPay = MP.SerialPay
                LEFT JOIN IsarRelation ir ON MP.IsarRelationCode = ir.IsarRelationCode
                LEFT JOIN Isars i ON MP.IsarCode = i.IsarCode
                WHERE cv.YearMonth=140312 AND cv.SerialPay=1 AND cv.CodePayID = 970 
                AND (MP.IsarCode != 0 OR MP.IsarRelationCode != 0)";

            string query2 = @"
                SELECT MP.[EmpID] As 'پرسنلی', MP.[TaxTypeCode] As 'کد مالیات', 
                       trst.Description As 'شرح مالیات', MP.[InsTypeCode] As 'نوع بیمه', ibt.Description As 'شرح بیمه'
                FROM [dbo].[MastPays] MP
                JOIN SumCurrentValues scv ON scv.YearMonth=MP.YearMonth AND scv.EmpID=MP.EmpID AND scv.SerialPay=MP.SerialPay
                LEFT JOIN [TaxRuleSalaryTitles] trst ON trst.[TaxRuleSalaryTitleCode] = MP.TaxTypeCode
                LEFT JOIN [InsBaseTypes] ibt ON ibt.[InsBaseTypeCode] = MP.InsTypeCode
                WHERE scv.YearMonth=140312 AND scv.SerialPay=1 AND scv.CodePayID=970";
            string query3 = @"
            	SELECT   MastPays.EmpID As 'پرسنلی', InsBaseTypes.Description AS 'بیمه پایه', Marriages.Description AS 'وضعیت تاهل', MastPays.InsNumberMain AS 'اصلی', MastPays.InsNumberOne As 'تبعی 1', MastPays.InsNumberTwo As 'تبعی 2', MastPays.InsNumberThree As 'تبعی 3',
                            MastPays.InsNumberFour As 'تبعی 4'
                             FROM  MastPays 
							 Left JOIN  InsBaseTypes ON MastPays.InsTypeCode = InsBaseTypes.InsBaseTypeCode 
							 Left JOIN  Marriages ON MastPays.MarriageCode = Marriages.MarriageCode
							 WHERE (MastPays.YearMonth = 140312) And (MastPays.SerialPay = 1) And (MastPays.Rpind = 1)
							 ORDER BY MastPays.EmpID

            ";
            
            
            string query4 = @"
		            SELECT 
					    MP.EmpID As 'پرسنلی', 
					    InsBaseTypes.Description AS 'بیمه پایه', 
					    Marriages.Description AS 'وضعیت تاهل', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsTakmiliType AS VARCHAR(50)), 'ندارد') AS 'بیمه تکمیلی', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsNo1 AS VARCHAR(50)), 'ندارد') AS 'تبعی 1', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsNo2 AS VARCHAR(50)), 'ندارد') AS 'تبعی 2', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsNo3 AS VARCHAR(50)), 'ندارد') AS 'تبعی 3', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsNo4 AS VARCHAR(50)), 'ندارد') AS 'تبعی 4', 
					    COALESCE(CAST(EmployeeInsTakmilis.InsNo5 AS VARCHAR(50)), 'ندارد') AS 'تبعی 5'
					FROM 
					    MastPays MP
					INNER JOIN 
					    InsBaseTypes ON MP.InsTypeCode = InsBaseTypes.InsBaseTypeCode 
					INNER JOIN 
					    Marriages ON MP.MarriageCode = Marriages.MarriageCode 
					LEFT JOIN 
					    EmployeeInsTakmilis ON MP.YearMonth = EmployeeInsTakmilis.YearMonth 
					    AND MP.SerialPay = EmployeeInsTakmilis.SerialPay 
					    AND MP.EmpID = EmployeeInsTakmilis.EmpID
					WHERE 
					    MP.YearMonth = 140312 AND MP.SerialPay = 1 AND MP.Rpind = 1 AND EmployeeInsTakmilis.ActiveStatus = 0
					ORDER BY 
					    MP.EmpID";
            string query5 = @"
					SELECT 
					    mp.EmpID AS 'پرسنلی',
					    mp.LastMogharari AS 'آخرین مقرری',
					    mp.Accno AS 'شماره حساب',
					    mp.InsDateUp30 AS 'بالای 30 سال',
					    mp.LastMogharariDaneshjoo AS 'آخرین مقرری دانشجو'
					FROM 
					    MastPays mp
					WHERE 
					    mp.YearMonth = 140312 
					    AND mp.Rpind = 1
					    AND mp.SerialPay = (
					        SELECT MAX(SerialPay) 
					        FROM MastPays 
					        WHERE EmpID = mp.EmpID AND YearMonth = 140312 AND Rpind = 1
					    )";

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                try
                {
                    connection.Open();
                    ExportQueryToCSV(connection, query1, database + "_ایثارگری1.csv");
                    ExportQueryToCSV(connection, query2, database + "_ایثارگری2.csv");
                    ExportQueryToCSV(connection, query3, database + "_خدمات.csv");
                    ExportQueryToCSV(connection, query4, database + "_تکمیلی.csv");
                    ExportQueryToCSV(connection, query5, database + "_مقرری.csv");
                 	
                    MessageBox.Show("عمليات با موفقیت انجام شد");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message);
                }
            }
        }

        private void ExportQueryToCSV(SqlConnection connection, string query, string fileName)
        {
            using (SqlCommand command = new SqlCommand(query, connection))
            using (SqlDataReader reader = command.ExecuteReader())
            using (StreamWriter writer = new StreamWriter(fileName, false, Encoding.UTF8))
            {
                // Write header
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    writer.Write(reader.GetName(i));
                    if (i < reader.FieldCount - 1)
                        writer.Write(",");
                }
                writer.WriteLine();

                // Write rows
                while (reader.Read())
                {
                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        writer.Write(reader[i]);
                        if (i < reader.FieldCount - 1)
                            writer.Write(",");
                    }
                    writer.WriteLine();
                }
            }
        }

        private void Label2Click(object sender, EventArgs e)
        {
            // Tooltip is already set in the constructor
            toolTip.Show("contact: <PRESIDIO_ANONYMIZED_PHONE_NUMBER>", label2);
        }

        private void MainForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                toolTip.Show("contact: <PRESIDIO_ANONYMIZED_PHONE_NUMBER>", this);
            }
        }

        private void Button1Click(object sender, EventArgs e)
        {
            ExecuteQueriesAndExportToCSV();
        }
        
        private void Button2Click(object sender, EventArgs e)
        {
           
        	ExtractDataFromAccessDatabase(database);
        }
        
        
        private void ExtractDataFromAccessDatabase(string fileName)
        {
            string mdbPath = FindMdbFile();
            if (string.IsNullOrEmpty(mdbPath))
            {
                MessageBox.Show("فایل دیتابیس تامین اجتماعی یافت نشد");
                return;
            }

            string outputFile = Path.Combine(Directory.GetCurrentDirectory(), database + "_بیمه تامین.csv");

            if (ExtractColumns(mdbPath, outputFile))
            {
                MessageBox.Show("فایل با موفقیت ذخیره شد");
            }
            else
            {
                MessageBox.Show("خطا در استخراج اطلاعات");
            }
        }

        private string FindMdbFile()
        {
            // Check common locations first
            string programFilesX86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
            string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

            string[] pathsToCheck = {
                Path.Combine(programFilesX86, @"Tamin\DataBase\Manufactory2.mdb"),
                Path.Combine(programFiles, @"Tamin\DataBase\Manufactory2.mdb")
            };

            foreach (var path in pathsToCheck)
            {
                if (File.Exists(path))
                {
                    return path;
                }
            }

            // If not found, prompt user
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Title = "Locate Manufactory2.mdb";
                openFileDialog.Filter = "Access Database Files (*.mdb)|*.mdb";
                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

                return openFileDialog.ShowDialog() == DialogResult.OK ? openFileDialog.FileName : null;
            }
        }

        private bool ExtractColumns(string mdbPath, string outputPath)
        {
            // Define the columns to extract
            string[] columnNames = { "Per_Bim", "Per_NatCod", "Per_Pers", "Per_LName", "Per_FName" };

            // Try both Jet and ACE providers without requiring installation
            string[] providersToTry = {
                "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=",
                "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
            };

            foreach (var provider in providersToTry)
            {
                try
                {
                    string connectionString = provider + mdbPath + ";";
                    //MessageBox.Show(connectionString);
                    using (OleDbConnection connection = new OleDbConnection(connectionString))
                    {
                        connection.Open();

                        // Check if the table 'Bim_Spec' exists and has the necessary columns
                        DataTable schema = connection.GetOleDbSchemaTable(
                            OleDbSchemaGuid.Columns,
                            new object[] { null, null, "Bim_Spec", null });

                        if (schema == null || schema.Rows.Count < columnNames.Length)
                        {
                            MessageBox.Show("Error: Bim_Spec table doesn't have the required columns.");
                            return false;
                        }

                        // Execute query to select the defined columns
                        string query = "SELECT " + string.Join(", ", columnNames) + " FROM Bim_Spec";
                        using (OleDbCommand command = new OleDbCommand(query, connection))
                        using (OleDbDataReader reader = command.ExecuteReader())
                        using (StreamWriter writer = new StreamWriter(outputPath, false, Encoding.UTF8))
                        {
                            // Write header
                            writer.WriteLine(string.Join(",", columnNames));

                            // Write data
                            while (reader.Read())
                            {
                                StringBuilder line = new StringBuilder();
                                for (int i = 0; i < columnNames.Length; i++)
                                {
                                    if (i > 0)
                                    {
                                        line.Append(",");
                                    }
                                    line.Append("\"").Append(reader[i].ToString().Replace("\"", "\"\"")).Append("\"");
                                }
                                writer.WriteLine(line.ToString());
                            }
                        }
                    }
                    return true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Attempt with " + provider.Split('=')[1].Split(';')[0] + " failed: " + ex.Message);
                }
            }

            MessageBox.Show("All connection attempts failed. Try installing Microsoft Access Database Engine.");
            return false;
        }
		void Label3MouseDoubleClick(object sender, MouseEventArgs e)
		{
			
			string queryEblaghFix = @"
			
			Insert Into EblaghPrsns(RegionCode,YearMonth,SerialPay,EmpID,UnitCode,HashCode)
			  Select RegionCode,140401,1,EmpID,UnitCode,HashCode FROM EblaghPrsns
			  where YearMonth=140312
			
			";
			using (SqlConnection connection = new SqlConnection(connectionString))
			{
				 using (SqlCommand command = new SqlCommand(queryEblaghFix, connection))
				 {
				 	try
			            {
			                connection.Open();
			                //int rowsAffected = command.ExecuteNonQuery(); // Use ExecuteNonQuery for INSERT commands
			                using (SqlDataReader reader = command.ExecuteReader())
			                MessageBox.Show("عملیات با موفقیت انجام شد");
			            }
			            catch (Exception ex)
			            {
			                MessageBox.Show("خطا");
			            }
				 
				 
				 }



				
        	}
			
		}
       
        
        
        
    }

}
```
change it to execute query queryEblaghFix from connestionstreing that in config.txt file