コード例 #1
0
        public int AddRecords(string hostFile, DataSet newRecords)
        {
            HostFileCommand cmd = new HostFileCommand(_conn);

            cmd.CommandText = string.Format("SELECT * FROM {0}", hostFile);

            HostFileDataAdapter adapter = new HostFileDataAdapter();

            adapter.SelectCommand = cmd;

            return(adapter.Update(newRecords));
        }
コード例 #2
0
        public DataSet GetFileDataSet(string hostFile)
        {
            DataSet         result = new DataSet();
            HostFileCommand cmd    = new HostFileCommand(_conn);

            cmd.CommandText = string.Format("SELECT * FROM {0}", hostFile);

            HostFileDataAdapter adapter = new HostFileDataAdapter();

            adapter.SelectCommand = cmd;

            adapter.Fill(result);

            cmd.Dispose();

            return(result);
        }