Webservice Datasource Error

Discussion in 'ASP.NET / ASP.NET Core' started by maddyrafi, Apr 27, 2012.

  1. My 1st appln webservice.cs coding is:

    [WebMethod]


    public DataSet GetProducts()

    {

    string conn = ConfigurationManager.ConnectionStrings["travel"].ToString();

    SqlDataAdapter adap;


    DataSet ds;

    string qry = "select * from tbl_login";
    adap =

    new SqlDataAdapter(qry, conn);

    ds = new DataSet();
    adap.Fill(ds);



    return ds;

    }


    My 2nd appln Default.aspx Source is:

    protected void Button1_Click(object sender, EventArgs e)
    {



    WebService ws = new WebService();



    GridView1.DataSource = ws.GetProducts();error getting here...

    GridView1.DataBind();

    }

    Error 1 'System.Web.Services.WebService' does not contain a definition for 'GetProducts' and no extension method 'GetProducts' accepting a first argument of type 'System.Web.Services.WebService' could be found (are you missing a using directive or an assembly reference?)

    i have 2 appln 1st appln webservice.cs form only, and in 2nd appln default.aspx page only...
    in 2nd appln i have add web reference and write button code but button code shows error ?

    how to clear this... ? i want how to get the GetProducts(); in my 2nd appln ?
     
  2. i have one form like transport information, in that form i have 3 textbox, in 1st textbox i put trichy in 2nd textbox i put chennai in 3rd textbox enter date and give search means the search want to search in this http://www.ticketgoose.com/ website and give me result in my form gridview how will i do this ?

    i mean i want to fetch database from other website and show me the result to my web form ?
     

Share This Page