Aspose.Cells.GridWeb.Examples.CSharp.Miscellaneous.DataBind.ExpandChildView.BindWithoutInSheetHeaders C# (CSharp) Method

BindWithoutInSheetHeaders() private method

private BindWithoutInSheetHeaders ( ) : void
return void
        private void BindWithoutInSheetHeaders()
        {
            // Create dataset object
            this.dataSet21 = new DataSet2();

            // Create demo database
            DemoDatabase2 db = new DemoDatabase2();

            // Create path to database file
            string path = (this.Master as Site).GetDataDir();

            // Create connection string
            db.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\Miscellaneous\\Database\\Northwind.mdb";
            try
            {
                // Connects to database and fetches data.
                // Customers Table.
                db.oleDbDataAdapter1.Fill(dataSet21);
                // Orders Table.
                db.oleDbDataAdapter2.Fill(dataSet21);
                // OrderDetailTable.
                db.oleDbDataAdapter3.Fill(dataSet21);

                // Create web worksheet object 
                WebWorksheet sheet = GridWeb1.WebWorksheets[0];

                // Clears the sheet.
                sheet.Cells.Clear();

                // Disables creating in-sheet headers.
                sheet.EnableCreateBindColumnHeader = false;

                // Data cells begin from row 0.
                sheet.BindStartRow = 0;

                // Bind the sheet to the dataset.    
                sheet.DataSource = dataSet21;
                sheet.DataBind();
            }
            finally
            {
                //Close connection
                db.oleDbConnection1.Close();
            }
        }