Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Autocomplete and datatable ?

$
0
0

Hello

I have below codes. How can i combine both of them ?

Thanks.

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static string[] GetCompletionList2(string prefixText, int count, string contextKey)
    {
        // Create array of movies
        string[] movies = { "Star Wars", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II" };

        // Return matching movies
        return (from m in movies where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
    }
void records()
{
 SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
        if (cn.State != System.Data.ConnectionState.Open)
        {
            cn.Open();
        }
        SqlCommand cmd = new SqlCommand("showmorevideo10", cn);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlParameter id13 = cmd.Parameters.Add("@StartingRow", SqlDbType.Int);
        id13.Direction = ParameterDirection.Input;
        id13.Value = 1;
        SqlParameter id113 = cmd.Parameters.Add("@txt", SqlDbType.VarChar, 100);
        id113.Direction = ParameterDirection.Input;
        id113.Value = txtMovie.Text;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
cn.Close();
}


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>