Exemplo n.º 1
0
        public DataSet GetData(int item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");
            Student = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Student WHERE StudentNum =\"" + item + "\"";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return ds;
        }
Exemplo n.º 2
0
        public DataSet GetData(int item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");

            Student = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string            sql     = "SELECT * FROM Student WHERE StudentNum =\"" + item + "\"";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return(ds);
        }
Exemplo n.º 3
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");
            Student = new ArrayList();
            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Student WHERE studentNum =\"" + str + "\"";

                SQLiteCommand cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StudentData.studentNum =Convert.ToInt32(rdr["studentNum"]);
                    StudentData.name = rdr["name"].ToString();
                    StudentData.phone = rdr["phone"].ToString();
                    Student.Add(Student);
                }
                rdr.Close();
            }
            return Student;
        }
Exemplo n.º 4
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");

            Student = new ArrayList();
            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Student WHERE studentNum =\"" + str + "\"";

                SQLiteCommand    cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StudentData.studentNum = Convert.ToInt32(rdr["studentNum"]);
                    StudentData.name       = rdr["name"].ToString();
                    StudentData.phone      = rdr["phone"].ToString();
                    Student.Add(Student);
                }
                rdr.Close();
            }
            return(Student);
        }