Exemplo n.º 1
0
    /// get user XML file method
    // gets all info for XML gridview
    public DataSet GetUserXMLFile()
    {
        // new dataset
        DataSet xmlDataSet = new DataSet();

        try
        {
            // path for XML
            xmlDataSet.ReadXml(dataPath + "user.xml");
        }
        catch (System.IO.FileNotFoundException error)
        {
            // get users info & write XML
            dsProgramaholics userList = myDataLayer.GetAllUsers();
            userList.tblUserDetails.WriteXml(dataPath + "user.xml");
            xmlDataSet.ReadXml(dataPath + "user.xml");
        }
        // return data
        return(xmlDataSet);
    }
Exemplo n.º 2
0
    /// BindUserGrid method
    // binds gridview to data
    private dsProgramaholics BindUserGrid()
    {
        // path
        string       tempPath = Server.MapPath("~/App_Data/Programaholics.mdb");
        clsDataLayer myData   = new clsDataLayer(tempPath);

        // get users
        dsProgramaholics userList = myData.GetAllUsers();

        // fill gridview
        gvUsers.DataSource = userList.tblUserDetails;

        // bind gridview
        gvUsers.DataBind();
        Cache.Insert("UserDataSet", userList);

        return(userList);
    }