Doug, Sorry I was of no help, but glad you got it working! Dean
-----Original Message----- From: Doug Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 26, 2004 8:02 AM To: [EMAIL PROTECTED] Subject: RE: [AspNetAnyQuestionIsOk] How to return a typed dataset from a web service Hi Dean Thanks for the article - but apart from the application blocks it basically spat my code back at me. Believe it or not, the problem (that took me 2 days to solve) was that I was passing the wrong ID through - hence no records. Feel like a bit of chop. Thanks again Doug Wilson | Lead Applications Developer | iX Webhouse iX Headoffice | Umhlanga, South Africa | Mobile: +2783 6412944 Tel: +2731 5669250 | Fax: +2731 5669260 | Email: mailto:[EMAIL PROTECTED] _____ From: Dean Fiala [mailto:[EMAIL PROTECTED] Sent: 25 May 2004 03:36 PM To: [EMAIL PROTECTED] Subject: RE: [AspNetAnyQuestionIsOk] How to return a typed dataset from a web service Oops. Hit that send a little too soon. Don't see any obvious problems, but try closing your reader connection before you create the DataSet. Here's an article on working with typed datasets over a web service that could be helpful. Discusses sharing the type properly between the client and server assembly. http://www.aspnetpro.com/NewsletterArticle/2004/02/asp200402nb_l/asp200402nb _l.asp HTH, Dean Fiala ----------------------------- Very Practical Software, Inc. http://www.vpsw.com/links.aspx -----Original Message----- From: Doug Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 25, 2004 8:33 AM To: [EMAIL PROTECTED] Subject: [AspNetAnyQuestionIsOk] How to return a typed dataset from a web service Bespoke Applications Development Team _____ Hi All I have a DAL method that return a typed data set (dsProductCatalogue) from the SQL database. When this project is included in my server application, it works fine, but when I call the same method from within my web service, it does not return all records, even though the schema returned is correct, and the first record from the first table is returned. Can anyone tell me what I'm doing wrong? DAL Method Signature: public ProductCatalogueDAL.dsProductCatalogue CreateDataSet(string strConn, int intDealerID) WebService: [WebMethod] public ProductCatalogueDAL.dsProductCatalogue GetDataSet(string strUsername, string strPassword) { string strConn = ConfigurationSettings.AppSettings["conn"]; SqlConnection conn = new SqlConnection(strConn); string sql = "SELECT ID FROM Dealerships WHERE Email = '" + Resin.DataHelper.antiInject(strUsername) + "' AND Password = '" + Resin.DataHelper.antiInject(strPassword) + "'"; SqlCommand cmd = new SqlCommand(sql,conn); cmd.Connection.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { ProductCatalogueDAL.User usr = new ProductCatalogueDAL.User(); usr.DealerID = Convert.ToInt32(dr["ID"]); ProductCatalogueDAL.ProdCatDataAccessor pcda = new ProductCatalogueDAL.ProdCatDataAccessor(); ProductCatalogueDAL.dsProductCatalogue ds = new ProductCatalogueDAL.dsProductCatalogue(); ds = pcda.CreateDataSet("Server=127.0.0.1;uid=sa;pwd=;Database=AW_ProdCats", usr.DealerID); return ds; } cmd.Connection.Close(); return null; } _____ Doug Wilson | Lead Applications Developer | iX Webhouse iX Headoffice | Umhlanga , South Africa | Mobile: +2783 6412944 Tel: +2731 5669250 | Fax: +2731 5669260 | Email: [EMAIL PROTECTED] [Non-text portions of this message have been removed] Yahoo! Groups Links Yahoo! Groups Sponsor ADVERTISEMENT <http://rd.yahoo.com/SIG=129t8l7fq/M=295196.4901138.6071305.3001176/D=groups /S=1705006764:HM/EXP=1085578569/A=2128215/R=0/SIG=10se96mf6/*http:/companion .yahoo.com> click here <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S= :HM/A=2128215/rand=914132179> _____ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] e> * Your use of Yahoo! Groups is subject to the Yahoo! <http://docs.yahoo.com/info/terms/> Terms of Service. [Non-text portions of this message have been removed] Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Yahoo! Domains - Claim yours for only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
