Home
english
Home
WebDAV Server
WebDAV Client
WebDAV AJAX
Map Drive
Pricing
News
Contacts
info@ithit.com

IHierarchyItem.GetProperties Implementation Example

public void GetProperties(ref Property[] props)

{

    OleDbConnection conn = new OleDbConnection(connStr);

    OleDbCommand cmd;

    OleDbDataReader reader = null;

    conn.Open();

 

    try

    {

        cmd = conn.CreateCommand();

        cmd.CommandText = "SELECT Name, Namespace, PropVal"

            + " FROM Properties"

            + " WHERE ItemID = ?";

 

        cmd.Parameters.Add("@ItemID", OleDbType.Integer).Value = ID;

 

        reader = cmd.ExecuteReader();

        if (props == null) // get all properties

        {

            List<Property> l = new List<Property>();

            while (reader.Read())

            {

                Property p = new Property();

                p.Name = reader.GetString(reader.GetOrdinal("Name"));

                p.Namespace = reader.GetString(reader.GetOrdinal("Namespace"));

                p.Value = reader.GetString(reader.GetOrdinal("PropVal"));

                l.Add(p);

            }

            props = l.ToArray();

        }

        else // get selected properties

        {

            while (reader.Read())

            {

                string propName = reader.GetString(reader.GetOrdinal("Name"));

                string propNamespace = reader.GetString(reader.GetOrdinal("Namespace"));

                for (int i = 0; i < props.Length; i++)

                    if (propName == props[i].Name && propNamespace == props[i].Namespace)

                    {

                        props[i].Value = reader.GetString(reader.GetOrdinal("PropVal"));

                        break;

                    }

            }

        }

    }

    finally

    {

        if (reader != null) reader.Close();

        conn.Close();

    }

}


What WebDAV software would you like to have?

Selected Customers:
Country: Norway
DnB NOR Group
Country: Finland
Bank of Finland
Country: United Kingdom
Bechtle Direct
Country: Sweden
BT Industries
Country: USA
California Chamber of Commerce
Country: Denmark
Danfoss Group
Country: Denmark
DFDS
Country: USA
Fluke Networks
Country: USA
HNI Corporation
Country: USA
IHS Inc
Country: USA
LandAmerica Financial Group
Country: Canada
Laurentian University
Country: USA
Microsoft
Country: Israel
RADVISION
Country: Ukraine
Raiffeisen Bank
Country: Netherlands
Sanoma Uitgevers
Country: USA
Siemens
Country: Australia
WorkCover NSW
Country: Ukraine
OTP Bank
Country: USA
Intel Corporation
Country: Austria
Austrian Federal Railways
Home WebDAV Server WebDAV Client WebDAV AJAX Map Drive Pricing News Contacts

Updated: Tuesday, December 05, 2006