Example #1
0
        public void FillDataSets(NBADWDataEntryApplication.dsDE_ESAFSiteList dataSet1)
        {
            // Turn off constraint checking before the dataset is filled.
            // This allows the adapters to fill the dataset without concern
            // for dependencies between the tables.
            dataSet1.EnforceConstraints = false;
            try
            {
                // Open the connection.
                this.oleDbConnection1.Open();
                // Attempt to fill the dataset through the OleDbDataAdapter1.
                this.oleDbdaDE_ESAFSiteList.Fill(dataSet1);
            }
            catch (System.Exception fillException)
            {
                // Add your error handling code here.
                throw fillException;
            }
            finally
            {
                // Turn constraint checking back on.
                dataSet1.EnforceConstraints = true;
                // Close the connection whether or not the exception was thrown.
                this.oleDbConnection1.Close();

                System.IO.StringWriter sw1 = new System.IO.StringWriter();

                // Write the DataSet to the ViewState property.
                dataSet1.WriteXml(sw1);
                ViewState["dSet1"] = sw1.ToString();
            }
        }
        public void FillDataSets(NBADWDataEntryApplication.dscdEnvironmentalObservations_Groups dataSet1, NBADWDataEntryApplication.dscdEnvironmentalObservations dataSet2, NBADWDataEntryApplication.dstblEnvironmentalObservations dataSet3)
        {
            // Turn off constraint checking before the dataset is filled.
            // This allows the adapters to fill the dataset without concern
            // for dependencies between the tables.
            dataSet1.EnforceConstraints = false;
            dataSet2.EnforceConstraints = false;
            dataSet3.EnforceConstraints = false;
            try
            {
                // Open the connection.
                this.oleDbConnection1.Open();
                // Attempt to fill the dataset through the OleDbDataAdapter1.
                this.oleDbdacdEnvironmentalObservations_Groups.Fill(dataSet1);
                this.oleDbdacdEnvironmentalObservations.Fill(dataSet2);
                this.oleDbdatblEnvironmentalObservations.Fill(dataSet3);
            }
            catch (System.Exception fillException)
            {
                // Add your error handling code here.
                throw fillException;
            }
            finally
            {
                // Turn constraint checking back on.
                dataSet1.EnforceConstraints = true;
                dataSet2.EnforceConstraints = true;
                dataSet3.EnforceConstraints = true;
                // Close the connection whether or not the exception was thrown.
                this.oleDbConnection1.Close();

                System.IO.StringWriter sw1 = new System.IO.StringWriter();
                System.IO.StringWriter sw2 = new System.IO.StringWriter();
                //System.IO.StringWriter sw3 = new System.IO.StringWriter();

                // Write the DataSet to the ViewState property.
                dataSet1.WriteXml(sw1);
                dataSet2.WriteXml(sw2);
                //dataSet3.WriteXml(sw3);
                ViewState["dSet1"] = sw1.ToString();
                ViewState["dSet2"] = sw2.ToString();
                //ViewState["dSet3"] = sw3.ToString();

                //tEO = objdstblEnvironmentalObservations.Tables["tblEnvironmentalObservations"];
            }
        }