Newbie Question open a web service in excel

C

Chicagoboy27

Ok here is where I am at.... I have created a web service in vs 2005. I
have tested it and have been able to bind the content to a
gridview....... below is my code:

using System.Data.SqlClient;



/// <summary>
/// Summary description for dbconn
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class dbconn : System.Web.Services.WebService {

[WebMethod]
public DataSet GetTitleAuthors()
{

SqlConnection myConnection = new SqlConnection("Data
Source=JEREMY1;Initial Catalog=pubs;User ID=sa;Password=beth123");
SqlDataAdapter myCommand1 = new SqlDataAdapter("select * from
Authors", myConnection);
// SqlDataAdapter myCommand2 = new SqlDataAdapter("select * from
Titles", myConnection);

DataSet ds = new DataSet();
myCommand1.Fill(ds, "Authors");
// myCommand2.Fill(ds, "Titles");

return (ds);
}

I have downloaded the "Microsoft Offiec 2003 Web Service" a have
installed it.....

I am able to add the web service and it creates the necesary file

In excel I create a button and add the following code

Dim wsAuthors As New clsws_dbconn
Dim value As String

value = wsAuthors.wsm_GetTitleAuthors()

To be honest I am not sure how to return the 23 records that are in the
ds to the excel grid... any help or bump in the right direction would
be helpful
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top