AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 AutoCompleteExtender
Posted by nivedita on  11/16/2007 1:05:58 PM Category: AJAX
Add to my favorites
Email to friend
Hi,

I am trying to implement AuoCompleter extender and the code i written in that seems to be correct.
Here is the code in webservice and I added properties in autocompleteextender also.

[WebMethod]
public string[] GetCountryInfo(string prefixText, int count, string contextKey)
{
count = 10;
string sql;
if (contextKey == "Country")
sql = "Select Name from Loc_Countries Where Name like @prefixText";
else
sql = "Select Name from Loc_States Where Name like @prefixText";

SqlDataAdapter da = new SqlDataAdapter(sql,"Data Source=HOUSQL;Initial Catalog=QQM_Jeremy;Persist Security Info=false ;UId=QQM;Password=quick;");
da.SelectCommand.Parameters.Add("@prefixText",sqlDbType.VarChar,50).Value = prefixText + "%";
DataTable dt = new DataTable();
da.Fill(dt);

string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr[0].ToString(), i);
i++;
}
return items;
}
when i run this code giving error like "The name 'sqlDbType' does not exist in the current context".
I would really appreciate if somebody could help me out.





Post Your Reply Post New Question

 Viewer's Reply
Noting to worry
Answered By J.Balasubramaniyan on 11/29/2007 1:29:01 AM
don't use sqlDbType

problem in 's' qlDbType

use it with "SqlDbType"
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Introduction to Software Development
Introduction to Web Applications Development
Oracle Magazine