Ejemplo n.º 1
0
    public void RunQuery()
    {
        string qry = "";

        qry = txtQuery.Text.Trim().ToLower();
        IEnumerable outPut = null;
        //Get database tables
        ArrayList al = new ArrayList();

        foreach (var n in GetDBTables())
        {
            al.Add(n);
        }

        s03_DB_13029_randtDataContext sb = new s03_DB_13029_randtDataContext();
        Array a = sb.GetAllDBTables().ToArray();

        for (int j = 0; j < a.Length; j++)
        {
            switch (((GetAllDBTablesResult)(a.GetValue(j))).name)
            {
            case "tblEmail":
                IEnumerable <tblEmail> results = sb.ExecuteQuery <tblEmail>(qry);
                qryView.DataSource = results;
                break;

            case "tblLocation":
                IEnumerable <tblLocation> results1 = sb.ExecuteQuery <tblLocation>(qry);
                qryView.DataSource = results1;
                break;

            case "tblLogonId":
                IEnumerable <tblLogonId> results2 = sb.ExecuteQuery <tblLogonId>(qry);
                qryView.DataSource = results2;
                break;

            case "tblTimeExpensesSummary>":
                IEnumerable <tblTimeExpensesSummary> results3 = sb.ExecuteQuery <tblTimeExpensesSummary>(qry);
                qryView.DataSource = results3;
                break;

            case "tblWorkDescription":
                IEnumerable <tblWorkDescription> results4 = sb.ExecuteQuery <tblWorkDescription>(qry);
                qryView.DataSource = results4;
                break;
            }
        }

        qryView.DataBind();
    }
Ejemplo n.º 2
0
    protected IEnumerable GetDBTables()
    {
        s03_DB_13029_randtDataContext d = new s03_DB_13029_randtDataContext();

        return(d.GetAllDBTables());
    }