示例#1
0
文件: List.aspx.cs 项目: npenkrat/las
        protected void Page_Load(object sender, EventArgs e)
        {
            // The data source needs
            // to be bound to the GridView control only when the 
            // page is first loaded. Thereafter, the values are
            // stored in view state.                      
           // if (!IsPostBack)
            {

                // Declare the query string.
                //String queryString = 
                //"Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]";

                // Run the query and bind the resulting DataSet
                // to the GridView control.
                // DataSet ds = GetData(queryString);
               //DataSetList
                //DataSetArea ds = new DataSetArea();
                DataSet1 ds = new DataSet1();

                //Fill DataSet
                string SQLquery = "Select ID as Номер, Name as Участок From AreaTable";
                DataSet ds2 = FillDataSet(SQLquery);

                string text = "area1";
                int number = ds.ListTable.Rows.Count;
                ds.ListTable.Rows.Add(new object[] { number + 1, "участок1","Ленинский" ,1,2,3,4,5,6,7,1,2,3,4});
                ds.ListTable.Rows.Add(new object[] { number + 2, "участок2", "Львовская", 5, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 3, "участок3", "Ораниенбаумский", 6, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 4, "участок4", "Ветеранов", 2, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 5, "участок1", "Краснопутиловская", 6, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 6, "участок2", "Гоголя", 2, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 7, "участок6", "Ораниенбаумский", 6, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 8, "участок9", "Ветеранов", 2, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 9, "участок10", "Краснопутиловская", 6, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                ds.ListTable.Rows.Add(new object[] { number + 10, "участок12", "Гоголя", 2, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4 });
                            
               // ds.ListTable.Columns[0].Caption = "Идентификатор";
                

                //DataSet ds;
                if (ds.Tables.Count > 0)
                {
                    //for test
                    ASPxGridViewList.DataSource = ds;
                    //real data from bd
                   // ASPxGridViewList.DataSource = ds2;

                    //ASPxGridViewList.DataBound +=new EventHandler(ASPxGridViewList_DataBound);

                    //ASPxGridViewList.Columns[0].Visible = false;
                    ASPxGridViewList.DataBind();
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportDocument report = new ReportDocument();

            report.Load(Server.MapPath("~/CrystalReport1.rpt"));
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=F:\WebApplication1\WebApplication1\App_Data\Database1.mdf;Integrated Security=True");

            SqlDataAdapter adapter = new SqlDataAdapter("select * from Demo", con);

            DataSet ds = new DataSet("Demo");

            //   adapter.Fill(ds,"Demo");

            // report.SetDataSource(ds);

            DataSet1 dataSet1 = new DataSet1();

            DataSet1TableAdapters.TestTableAdapter testTableAdapter = new DataSet1TableAdapters.TestTableAdapter();
            testTableAdapter.Fill(dataSet1.Test);

            DataSet1TableAdapters.DemoTableAdapter demoTable = new DataSet1TableAdapters.DemoTableAdapter();
            demoTable.Fill(dataSet1.Demo);

            DataSet1TableAdapters.RecordTableAdapter recordTableAdapter = new DataSet1TableAdapters.RecordTableAdapter();
            recordTableAdapter.RecordBy(dataSet1.Record, 23);

            DataTable dataTable = new DataTable();

            adapter.Fill(dataTable);


            // dataSet1.Tables.Add(dataTable);
            report.SetDataSource(dataSet1);

            report.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "abc");
        }
示例#3
0
 public mierda()
 {
     da = new DataSet1();
 }