Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6001537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:50:55+00:00 2026-05-23T00:50:55+00:00

namespace ConsoleApplication2 { class Program { static void Main(string[] args) { MySqlConnection conDatabase =

  • 0
namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {


            MySqlConnection conDatabase = new MySqlConnection("Data Source=localhost;" +
                                       "Persist Security Info=yes;" +
                                       "UserId=tee; PWD=t421039; database=ph3;");
            conDatabase.Open();
            MySqlCommand cmdDatabase = new MySqlCommand("DROP TABLE IF EXISTS `q_mem_sur`; create table q_mem_sur as SELECT Count(*) As rowa,  member.Ssurname,  Sum(Case When ((member.status = '1')) Then 1 Else 0 End) As Status11 From member Group By member.Ssurname Order By rowa Desc;", conDatabase);



     string[] arr = new string[8];       
    arr[0] = "UPDATE `member` SET `amphurecode`= SUBSTRING(member.own,3,4)";               
    arr[1] = "UPDATE `member` SET `provincecode`= SUBSTRING(member.own,3,2)";
    arr[2] = "DROP TABLE IF EXISTS `q_mem_tim`; create table q_mem_tim as SELECT member.idmember, member.own, member.provincecode, province.PROVINCE_NAME, member.amphurecode, amphur.AMPHUR_NAME, member.Sname, member.Ssurname, member.Hno, member.Moo, member.Sex, member.tambol, member.dateofbirth, member.migratedate, Year( Current_Date( ) ) -  Year( member.dateofbirth ) AS y,  DATEDIFF('2011-08-01',(migratedate)) AS d FROM member LEFT JOIN amphur ON ( member.amphurecode  = amphur.AMPHUR_CODE ) LEFT JOIN province ON member.provincecode  = province.PROVINCE_CODE";
    arr[3] = "DROP TABLE IF EXISTS `q_mem_sur`; create table q_mem_sur as SELECT Count(*) As rowa,  member.Ssurname,  Sum(Case When ((member.status = '1')) Then 1 Else 0 End) As Status11 From member Group By member.Ssurname Order By rowa Desc";
    arr[4] = "DROP TABLE IF EXISTS `q_mem_hno`;create table q_mem_hno as select member.Hno, member.Moo, member.tambol, COUNT( member.Hno ) AS cntHno, COUNT(DISTINCT member.Ssurname) as NoSur ";
    arr[5] = "DROP TABLE IF EXISTS `q_pro_ori`;create table q_pro_ori as Select member.provincecode,   count(*) As cnt  From member Group By member.provincecode Order By cnt Desc ";
    arr[6] = "DROP TABLE IF EXISTS `q_am_ori`;create table q_am_ori as Select member.amphurecode,  member.provincecode,  count(*) As cnt  From member Group By member.amphurecode, member.provincecode Order By cnt Desc ";
    arr[7] = "DROP TABLE IF EXISTS `Sur_Hno_`;create table Sur_Hno_ as SELECT count( *  ) , Ssurname, q_mem_tim.Hno, q_mem_tim.Moo, q_mem_tim.tambol FROM q_mem_tim";

    foreach (string s in arr)
    {
        Console.WriteLine(s);
        MySqlCommand cmdDatabase = new MySqlCommand((s), conDatabase);
        cmdDatabase.CommandTimeout = 500;
        cmdDatabase.ExecuteNonQuery();
    }


            conDatabase.Close();


        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:50:55+00:00Added an answer on May 23, 2026 at 12:50 am
    MySqlCommand cmdDatabase = new MySqlCommand((s), conDatabase);
    

    It hides the below code:

        MySqlCommand cmdDatabase = new MySqlCommand("DROP TABLE IF EXISTS `q_mem_sur`; create table q_mem_sur as SELECT Count(*) As rowa,  member.Ssurname,  Sum(Case When ((member.status = '1')) Then 1 Else 0 End) As Status11 From member Group By member.Ssurname Order By rowa Desc;", conDatabase);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string word =
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var
This code: namespace ConsoleApplication3 { class Program { static void Main(string[] args) { var
The following piece of code namespace ConsoleApplication1 { class Program { static void Main(string[]
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
Consider the following code: using System; namespace ConsoleApplication2 { class Program { static void
Suppose I've got the following program: namespace ReflectionTest { public class Example { private
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace ConsoleApplication2 { class
I have this simple sample on VS2010: using System; namespace ConsoleApplication1 { class Program
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication5 { class Program {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.