Click here to Skip to main content
15,922,894 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How do you pass values to a datasource Pin
sana174-Feb-09 1:34
sana174-Feb-09 1:34 
QuestionHow do you add childnodes to a treeview? Pin
AndyASPVB1-Feb-09 10:35
AndyASPVB1-Feb-09 10:35 
QuestionImage not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 4:38
Anita_Kamat_inds1-Feb-09 4:38 
AnswerRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 12:43
Colin Angus Mackay1-Feb-09 12:43 
GeneralRe: Image not been displayed from SQL Pin
vaghelabhavesh1-Feb-09 13:02
vaghelabhavesh1-Feb-09 13:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 13:04
Colin Angus Mackay1-Feb-09 13:04 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:19
Anita_Kamat_inds1-Feb-09 16:19 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 8:43
Colin Angus Mackay2-Feb-09 8:43 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 9:02
Anita_Kamat_inds2-Feb-09 9:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 9:53
Colin Angus Mackay2-Feb-09 9:53 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 10:01
Anita_Kamat_inds2-Feb-09 10:01 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:06
Anita_Kamat_inds1-Feb-09 16:06 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:08
Anita_Kamat_inds1-Feb-09 16:08 
QuestionGridview binding to both base n derived classes Pin
dotnet.coder1-Feb-09 2:59
dotnet.coder1-Feb-09 2:59 
AnswerRe: Gridview binding to both base n derived classes Pin
Manas Bhardwaj1-Feb-09 4:01
professionalManas Bhardwaj1-Feb-09 4:01 
QuestionLabel and Absolute Positioning Pin
swjam1-Feb-09 1:15
swjam1-Feb-09 1:15 
QuestionAutocomplete AJAX Pin
CrimeanTurtle20081-Feb-09 0:23
CrimeanTurtle20081-Feb-09 0:23 
Hi All,

I am trying to use a autocomplete Ajax tool for a textbox to register search possibilities from the database. For some reason when I load up the application nothing happens. My web method is below and Im not sure if there is anything wrong with it since it does return an array of strings from the datatable.
Would someone be able to assist with this? Many thanks and kind regards.

<br />
using System;<br />
using System.Collections;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.Xml.Linq;<br />
using System.Collections.Generic;<br />
using System.Data;<br />
using System.Configuration;<br />
<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
<br />
using System.Data.SqlClient;<br />
<br />
/// <summary><br />
/// Summary description for WebService<br />
/// </summary><br />
[WebService(Namespace = "http://hello.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. <br />
[System.Web.Script.Services.ScriptService]<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
    public WebService () {<br />
<br />
        //Uncomment the following line if using designed components <br />
        //InitializeComponent(); <br />
    }<br />
<br />
<br />
   <br />
<br />
 <br />
[WebMethod]<br />
    public  string[] GetCountry(string country)<br />
    {<br />
<br />
        string query = "SELECT COUNTRY FROM CUSTOMERS WHERE COUNTRY LIKE @Country";<br />
        using (SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\NORTHWND.MDF;Integrated Security=True;User Instance=True"))//"Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\NORTHWIND.MDF;Integrated Security=True;User Instance=True"))<br />
        {<br />
<br />
            SqlDataAdapter adapter = new SqlDataAdapter(query, conn);<br />
            adapter.SelectCommand.Parameters.Add("@Country", SqlDbType.VarChar,15).Value = country + "%";<br />
            DataTable dt = new DataTable();<br />
            adapter.Fill(dt);<br />
            string[] items = new string[dt.Rows.Count];<br />
            int i = 0;<br />
            foreach (DataRow dr in dt.Rows)<br />
            {<br />
                items.SetValue(dr["Country"].ToString(), i);<br />
<br />
                i++;<br />
            }<br />
            return items ;<br />
<br />
<br />
<br />
<br />
        }<br />
    }<br />

Questionjavascript Pin
kushalrshah1-Feb-09 0:06
kushalrshah1-Feb-09 0:06 
AnswerRe: javascript Pin
mr_muskurahat1-Feb-09 3:17
mr_muskurahat1-Feb-09 3:17 
AnswerRe: javascript Pin
vaghelabhavesh1-Feb-09 12:56
vaghelabhavesh1-Feb-09 12:56 
GeneralRe: javascript Pin
kushalrshah1-Feb-09 17:57
kushalrshah1-Feb-09 17:57 
GeneralRe: javascript Pin
kushalrshah1-Feb-09 17:58
kushalrshah1-Feb-09 17:58 
GeneralRe: javascript Pin
vaghelabhavesh2-Feb-09 3:11
vaghelabhavesh2-Feb-09 3:11 
QuestionVBRUN : 80040154 Pin
coolestCoder31-Jan-09 21:07
coolestCoder31-Jan-09 21:07 
QuestionData Provider for Oracle/ODBC Pin
Girish48131-Jan-09 19:51
Girish48131-Jan-09 19:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.