You must Sign In to post a response.
  • Category: Webservices

    Reading data from a webservice in window universal

    Afternoon Everyone

    I am having a problem with reading data from a webservice in window Universal. Web service is returning a dataset, therefore I would like to read and display it. Web service is working fine, the problem is in my Button_Click method.

    This is how my code look like.
    ==============Window Universal============
    private void Button_Click(object sender, RoutedEventArgs e)
    MyWebServ.WebService1SoapClient sc = new WebService1SoapClient(); //My web service
    var result = sc.GetDataAsync(); //this method returns dataset from web service
    .........................? What do I do after this?
    ===========My Web Service==============
    public DataSet GetData()
    DataSet ds = new DataSet();
    string strSQL = "Select * from SchoolInfo";
    string strConStr = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = ASSDataSet.mdb; Persist Security Info = False;";
    con = new OleDbConnection(strConStr);
    OleDbCommand cmd = new OleDbCommand();
    cmd.Connection = con;
    cmd.CommandText = strSQL;
    cmd.CommandType = CommandType.Text;
    OleDbDataAdapter da = new OleDbDataAdapter(cmd);
    return ds;
  • #769570
    can you please share what error you are getting?
    - Pavan Pareta

  • Sign In to post your comments