TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sandy Surwase
NA
287
30.5k
i try autocomplete textbox but somthing is wrong plz help me
Oct 22 2012 6:44 AM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class autocompletdemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int count, string contextKey)
{
string cs = ConfigurationManager.ConnectionStrings["NorthwindCS"].ConnectionString;
SqlConnection cn = new SqlConnection(cs);
SqlDataAdapter da=new SqlDataAdapter("select ProductName from Products",cn);
DataSet ds = new DataSet();
da.Fill(ds, "Products");
DataView dv = new DataView(ds.Tables[0]);
dv.RowFilter = string.Format("ProductName like '{0}%'",prefixText);
int rcount, size;
rcount = dv.Count;
if (rcount >= count)
size = count;
else
size = rcount;
string[] Pnames = new string[size];
for (int i = 0; i < size; i++ )
{
Pnames[i] = dv.[i]["PoductName"].toString();
}
return Pnames;
}
}
there is error in marked line plz help mi out
Reply
Answers (
3
)
Read Clob Data
How to switch between existing views?