using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MySql.Data.MySqlClient;
using MysqlDLL;
namespace StuMgmClient
{
    class ClientMysql
    {
        MysqlDLL.MysqlDLL mys = new MysqlDLL.MysqlDLL();
        public DataSet SelectNode()
        {
            DataSet ds = new DataSet();
            MySqlConnection con= mys.DBconn();
            string str = "SELECT * FROM course_info";
            MySqlCommand cmd = new MySqlCommand(str, con);
            //cmd.Parameters.AddWithValue("temp", 0);
            MySqlDataAdapter msda = new MySqlDataAdapter(cmd);
            object val= cmd.ExecuteScalar();
            msda.Fill(ds, "course_info");
            return ds;
        }
        public DataSet SelectState()
        {
            DataSet ds = new DataSet();
            MySqlConnection con = mys.DBconn();
            string str = "SELECT * FROM user_info WHERE id=@temp";
            MySqlCommand cmd = new MySqlCommand(str, con);
            cmd.Parameters.AddWithValue("temp", 1);
            MySqlDataAdapter msda = new MySqlDataAdapter(cmd);
            object val = cmd.ExecuteScalar();
            msda.Fill(ds, "user_info");
            return ds;
        }
    }
}
