All pastes #89392 Raw Edit

Stuff

public text v1 · immutable
#89392 ·published 2006-07-16 05:38 UTC
rendered paste body
    [AjaxPro.AjaxMethod]
    public object[] OnAutoComplete(string value, int count)
    {
        try
        {
            string str = String.Format("SELECT TOP 10 SearchPhrase FROM SearchPhrase WHERE SearchPhrase LIKE '{0}%' ORDER BY SearchPhrase", value);

            DbDataReader _reader = Common.ExecuteReader(CommandType.Text, str);
            ArrayList _coll = new ArrayList();
            while (_reader.Read())
            {
                _coll.Add((string)_reader["SearchPhrase"]);
            }
            _reader.Close();
            return _coll.ToArray();
        }
        catch (Exception ex)
        {
            return null;
        }