Argentini.Halide.H3Reader.ReadTable C# (CSharp) Method

ReadTable() public method

Create a dynamic DataTable object from a SQL data statement. One use for this method is to create a data source for other controls that want a DataTable, like 3rd party controls.
public ReadTable ( ) : DataTable
return System.Data.DataTable
        public DataTable ReadTable()
        {
            return ReadTable(false);
        }

Same methods

H3Reader::ReadTable ( System.Boolean addBlank ) : DataTable

Usage Example

Example #1
0
        /// <summary>
        /// Loads the results of a SQL query into a DataTable object.
        /// Uses the default connection string "Halide".
        /// </summary>
        /// <example>
        /// <code>
        /// using Argentini.Halide;
        /// ...
        /// DataTable dt = H3Sql.ReadTable("SELECT TOP 5 FROM tablename;");
        /// </code>
        /// </example>
        /// <param name="statement">SQL statement to execute.</param>
        /// <returns>DataTable object.</returns>
        public static DataTable ReadTable(string statement)
        {
            DataTable dt = new DataTable();

            using (H3Reader reader = new H3Reader(statement))
            {
                dt = reader.ReadTable();
            }

            return (dt);
        }
All Usage Examples Of Argentini.Halide.H3Reader::ReadTable