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
khaleel shaik
NA
41
71k
AutoCompleteExtender control in user Control
Mar 29 2013 8:34 AM
I have removed the .asmx file and now try to run the Webmethod directly in the .ascx instead.
It works in a ASP.net WebApplication Webform(.Aspx Web Form)
[System.Web.Services.WebMethod]
public static string[] GetNames(string prefixText, int count)
{
List<String> hits = new List<String>();
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=(local);Initial Catalog=umbracodb;Integrated Security=True";
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.Parameters.Add("@Input", SqlDbType.VarChar, 50);
cmd.Parameters["@Input"].Value = "%" + prefixText + "%";
cmd.CommandText = "SELECT [Name] FROM [Product] WHERE [Name] like @Input";
cmd.ExecuteNonQuery();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
hits.Add(reader["Name"].ToString());
}
conn.Close();
conn.Dispose();
return hits.ToArray();
}
Reply
Answers (
0
)
RDLC - Default parameters
I Have create colorfull standard rdlc report with Heading