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)); }
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); }