public static void ReCreateProcedureIfInsertExists(dynamic dynamic)
        {
            SqlCommand command = new SqlCommand("", Connected.Connection);
            var        query   = InsertProcedure.Insert(dynamic, "ALTER");

            Commond.ExecuteQueryForText(command, query);
        }
        public static void Database(string name)
        {
            string        conn       = "Server=.;Initial Catalog=master;Integrated Security=True";
            SqlConnection Connection = new SqlConnection(conn);
            string        query      = $"CREATE DATABASE {name} ";
            SqlCommand    command    = new SqlCommand(query, Connection);

            command.CommandType = CommandType.Text;
            Commond.ExecuteQueryForText(command);
            WriteDbNameToFile(name);
        }
        public static bool CreateTable <T>(string name) where T : class
        {
            SqlConnection sqlConnection = new SqlConnection($"Data Source=.;Initial Catalog={name};Integrated Security=True");
            var           quers         = DbQuery <T> .Table(GetDbNameFromFile());

            SqlCommand command = new SqlCommand();

            command.Connection  = sqlConnection;
            command.CommandType = CommandType.Text;
            command.CommandText = quers;
            return(Commond.ExecuteQueryForText(command));
        }
Beispiel #4
0
        private static bool commoned(dynamic dynamic, string query)
        {
            SqlCommand command = new SqlCommand("", Connected.Connection);

            return(Commond.ExecuteQueryForText(command, query));
        }