|
this work for me and I am using in VS.NET 2005
<asp:ScriptManager id="ScriptManager1" runat="server"><br />
</asp:ScriptManager><br />
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtTo"<br />
ServicePath="WebService.asmx" Enabled="true" MinimumPrefixLength="1" ServiceMethod="MethodNameFromWebService"><br />
</cc1:AutoCompleteExtender>
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
OK, well there must be a problem with the web service then
The code is displayed below.When I type text in the box nothing appears
thanks
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class autocomplete : System.Web.Services.WebService {
[WebMethod(EnableSession = true)]
public string[] GetactdescInfo(string prefixText)
{
int count = 10;
string project = HttpContext.Current.Session["project"].ToString();
SqlConnection connectionString = new SqlConnection(ConfigurationManager.ConnectionStrings[project].ConnectionString);
connectionString.Open();
string sql = " SELECT description" +
" FROM act" +
" WHERE description like '" + prefixText + "' ";
//string description_condition = " AND description LIKE '%" + prefixText + "%'";
//sql += description_condition;
SqlDataAdapter dataAdapter1 = new SqlDataAdapter(sql, connectionString);
dataAdapter1.SelectCommand.Parameters.Add("@prefixText", SqlDbType.NVarChar, 2000).Value = prefixText + "%";
DataTable datatable1 = new DataTable();
dataAdapter1.Fill(datatable1);
string[] items = new string[datatable1.Rows.Count];
int i = 0;
foreach (DataRow datarow in datatable1.Rows)
{
items.SetValue(datarow["description"].ToString(), i);
i++;
}
return items;
}
}
|
|
|
|
|
.netman wrote: " WHERE description like '" + prefixText + "' ";
try to add precentage sign:
" WHERE description like '" + prefixText + "%' "
My webservice which works:
<%@ WebService Language="C#" Class="WebService" %><br />
<br />
using System;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
<br />
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService] <br />
<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
[WebMethod]<br />
public string[] GetUserName(string prefixText)<br />
{<br />
<br />
System.Data.DataSet dtst = new System.Data.DataSet();<br />
<br />
System.Data.SqlClient.SqlConnection sqlCon = new System.Data.SqlClient.SqlConnection("Data Source=.;Initial Catalog=BussinesTube;Integrated Security=True");<br />
<br />
string strSql = "SELECT name+' ' +lastname +' ; < '+ username + ' > 'as [name] from users WHERE [name] LIKE '%" + prefixText + "%' ";<br />
<br />
System.Data.SqlClient.SqlCommand sqlComd = new System.Data.SqlClient.SqlCommand(strSql, sqlCon);<br />
<br />
sqlCon.Open();<br />
<br />
System.Data.SqlClient.SqlDataAdapter sqlAdpt = new System.Data.SqlClient.SqlDataAdapter();<br />
<br />
sqlAdpt.SelectCommand = sqlComd;<br />
<br />
sqlAdpt.Fill(dtst);<br />
<br />
string[] cntName = new string[dtst.Tables[0].Rows.Count];<br />
<br />
int i = 0;<br />
<br />
try<br />
{<br />
<br />
foreach (System.Data.DataRow rdr in dtst.Tables[0].Rows)<br />
{<br />
<br />
cntName.SetValue(rdr["Name"].ToString(), i);<br />
<br />
i++;<br />
<br />
}<br />
<br />
}<br />
<br />
catch { }<br />
<br />
finally<br />
{<br />
<br />
sqlCon.Close();<br />
<br />
}<br />
<br />
return cntName;<br />
<br />
}<br />
<br />
<br />
<br />
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi thanks for the response.
I have added that and it still doesnt work.
Should there be any additonal lines in my c# code for the page the textbox is on?
|
|
|
|
|
When does prefixtext get set?
|
|
|
|
|
hi i am new user of asp.net using c#
problem is that i use a mater page which fill a datalist in iframe tag so open a new page and then goes to second page now when i click a datalist link button then i open a new mater page but that page is open on same td of mater page how i show a new page. every time when i clik on linkbutton its open in new datalist as a child of that form. while i want its open in a seprate page.
thanks in advance reply soon.
|
|
|
|
|
You try to open if in a parent page.
studing is processing in this life.
|
|
|
|
|
i understood what is the problem.
problem is that i am using iframe control but if i not use ifrmae than all value are comeout from my div tag what i use insted of iframe
thanks
|
|
|
|
|
hello
i am using master form.
and so how to write webform name on internet exlorer title bar.
pls help me.
gayatri
Gayatri
|
|
|
|
|
when u insert a form using mater page then u should chnge the <title>your web page name
example
]]>
i think its helpful for u.
|
|
|
|
|
Page.Title="Here goes title of the page";
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
I am creating a Bloggings in my site, so which is the best way to create bloggings, shall i use datagrid,repeater or something else. plz give me suggestion as soon as possible. Thank you.
coolsatty
|
|
|
|
|
Use whatever you like. The question makes no sense
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
You can use datalist.For its bigger using.
studing is processing in this life.
|
|
|
|
|
Hi,
Is it possible to find the quality of the image?
How can we find the image is with good quality or not?
|
|
|
|
|
Hi,
May be using Pixels.
Cheers,
sekhar
|
|
|
|
|
Not really an asp.net question is it.
|
|
|
|
|
This queston is ridiculous. How do you define 'quality'. ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Actually while cropping the image, the image quality will get disturbed.
so,if that image quality is poor,then i need to display some error message.
|
|
|
|
|
Well, it's not possible. You can't quantify image quality, easily, in code. You could do a histogram and see how it spreads, if you like, and decide that reflects quality, but it's going to be hit and miss.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
You can do it Manually by just looking on it
The Developer - CEH
|
|
|
|
|
I am developing a .net C# site. I want to add a world map to my site. World map should have some advanced features like google map. Do you know any ready made free map?
Or can I integrate google map with my site?
Thank you very much!
Charith Jayasundara
|
|
|
|
|
read google maps Document which u will get in http://code.google.com/apis/maps/documentation/
coolsatty
|
|
|
|
|
Hi,
I am generated PDF using iTextSharp.How to fixed the header text and footer text in all pages using iTextsharp.
Regards,
H.Subbulakshmi
|
|
|
|
|
Hi ,
I used file upload control to upload files. I have to find the uploaded flash file(.SWF) Height & Width. But How to find Height & Width of SWF file while uploading ?
Please suggest me...
Thanks in advance
sekhar
|
|
|
|