Featurel 1Listing 1SqlConnection <strong>con</strong>n = new SqlConnection("server=myserver;uid=myuser;pwd=mypwd;database=pubs");SqlCommand cmd = new SqlCommand("select au_id, au_lname from authors", <strong>con</strong>n);SqlDataReader rdr;try {<strong>con</strong>n.Open();rdr = cmd.ExecuteReader();while (rdr.Read())Console.WriteLine("author {0} has name {1}", rdr[0],rdr[1]);}catch (Exception e) {Console.WriteLine(e.Message);}finally {if (<strong>con</strong>n.State == ConnectionState.Open)<strong>con</strong>n.Close();}f 2 Figure2: Configuring a stored procedure toreturn SOAPThis complex type should be usableby any client, not only those writtenin ADO.NET.DataSet ds = new DataSet();l 2 Listing 2SqlDataAdapter da = new SqlDataAdapter("select au_id, au_lname from authors","server=myserver;uid=myuser;pwd=mypwd;database=pubs");// this classes builds commands to update the databaseSqlCommandBuilder bld = new SqlCommandBuilder(da);// <strong>con</strong>nection is closed here...da.Fill(ds, "authors");// <strong>con</strong>nection closed here toods.Tables[0].Rows[0][1] = "newlastname";da.Update(ds, "authors");Bob Beauchemin has more than 22years’ experience in the computerindustry as an instructor, courseauthor, s<strong>of</strong>tware developer, and<strong>sys</strong>tems administrator. He’s currentlya senior staff instructor atDevelopMentor, curriculum liaison forthe data access curriculum, andauthor <strong>of</strong> courses on ADO.NET, OLEDB, ADO, SQL Server applicationdevelopment, and Java data access.bobb@develop.comHOMEDirect Programmatic AccessWe’ve seen how SQLXML lets usproduce Web services <strong>con</strong>sumable byany client with little or no coding onthe server side. We wouldn’t want touse these services gratuitously if <strong>con</strong>sumingTDS directly is possible; usingTDS instead <strong>of</strong> XML is always going tobe more efficient. But for situations inwhich we want to make SQL Serveravailable to non-Micros<strong>of</strong>t clients,combining SQL, XML, and SOAP maybe an easy way to achieve interoperability.When using .NET clients, thisgives us the ability to permit <strong>con</strong>trolledaccess to our SQL Server withoutrequiring either direct access orwriting an ASP.NET Web service application.A Web service allows directprogrammatic access.Advertiser IndexADVERTISER URL PHONE PGAltova www.altova.com 978.816.1600 4Crystal Decisions www.crystaldecisions.com/cr9/021/ 888.333.6007 27DataDirect www.datadirect-technologies.com/<strong>net</strong> 800.876.3101 13Gartner www.gartner.com/us/eai 800.778.1997 19Infragistics, Inc. www.infragistics.com 800.231.8588 2, 3Interland www.interland.com 800.845.8706 28/n s<strong>of</strong>tware inc. www.ns<strong>of</strong>tware.com 919.402.0590 15Rational S<strong>of</strong>tware www.rational.com/<strong>of</strong>fer/webservices13 800.728.1212 11SERVERDESKTOPEVERYWHERENext TimeSince .NET has been released,a plethora <strong>of</strong> .NET data providershave also hit the market. Nexttime we’ll discuss strategies formigrating existing code, lookingat how the ADO.NET modelmakes it easier for provider writersto expose data source–specificfeatures, and how this affectsinteroperability.Sams Publishing www.samspublishing.com 317.581.3500 9SYS-CON Media www.<strong>sys</strong>-<strong>con</strong>.com/dot<strong>net</strong>/ 888.303.5282 21General Conditions: The Publisher reserves the right to refuse any advertising not meeting the standards that are set to protect the high editorialquality <strong>of</strong> Dot Net Developer’s Journal. All advertising is subject to approval by the Publisher. The Publisher assumes no liability for any costs ordamages incurred if for any reason the Publisher fails to publish an advertisement. In no event shall the Publisher be liable for any costs or damagesin excess <strong>of</strong> the cost <strong>of</strong> the advertisement as a result <strong>of</strong> a mistake in the advertisement or for any other reason.The Advertiser is fully responsiblefor all financial liability and terms <strong>of</strong> the <strong>con</strong>tract executed by the agents or agencies who are acting on behalf <strong>of</strong> the Advertiser. Conditions setin this document (except the rates) are subject to change by the Publisher without notice. No <strong>con</strong>ditions other than those set forth in this “GeneralConditions Document” shall be binding upon the Publisher. Advertisers (and their agencies) are fully responsible for the <strong>con</strong>tent <strong>of</strong> their advertisementsprinted in Dot Net Developer’s Journal.Advertisements are to be printed at the discretion <strong>of</strong> the Publisher.This discretion includes the positioning<strong>of</strong> the advertisement, except for “preferred positions” described in the rate table. Cancellations and changes to advertisements must bemade in writing before the closing date. “Publisher” in this “General Conditions Document” refers to SYS-CON Publications, Inc.20Preview Issue • dot<strong>net</strong>developers<strong>journal</strong>.com
introductorysubscription <strong>of</strong>fer!A TRULY INDEPENDENTVOICE IN THE WORLD OF .NET.NET Developer’s Journal is the leadingindependent monthly publication targeted at .NETdevelopers, particularly advanced developers. It brings.NET developers everything they need to know in orderto create great s<strong>of</strong>tware.Publishedmonthly, .NETDeveloper’sJournal coverseverything <strong>of</strong> interest todevelopers working withMicros<strong>of</strong>t .NET technologies– all from acompletely independentand unbiased perspective.Articles are carefullyselected for their primetechnical <strong>con</strong>tent – technicaldetails aren’t watered down withSUBSCRIBE ONLINE!www.<strong>sys</strong>-<strong>con</strong>.com/dot<strong>net</strong>/or Call1 888 303-5282Here’s what you’ll find inevery issue <strong>of</strong> .<strong>net</strong>dj:Security WatchMobile .NET.NET TrendsTech TipsStandards WatchBusiness Alerts.NET NewsBook and S<strong>of</strong>twareAnnouncements.NET Developer’s Journal is for .NETdevelopers <strong>of</strong> all levels, especially those “inthe trenches” creating .NET code on a dailybasis:• For beginners:Each issue <strong>con</strong>tains step-by-step tutorials.• For intermediate developers:There are more advanced articles.• For advanced .NET developers:In-depth technical articles and columnswritten by acknowledged .NET experts.Regardless <strong>of</strong> their experience level, .NETDeveloper’s Journal assumes that everyonereading it shares a common desire to understandas much about .NET – and the businessforces shaping it – as possible. Our aimis to help bring our reader-developers closerand closer to that goal with each and everynew issue!lots <strong>of</strong> needless opinion and commentary.Apart from the technical <strong>con</strong>tent, expert analystsand s<strong>of</strong>tware industry commentators keep developersand their managers abreast <strong>of</strong> the businessforces influencing .NET’s rapid development.Wholly independent <strong>of</strong> both Micros<strong>of</strong>t Corporationand the other main players now shaping the course <strong>of</strong>.NET and Web services, .NET Developer’s Journalrepresents a <strong>con</strong>stant, neutral, expert voice on thestate <strong>of</strong> .NET today – the good, the bad, and theugly…no exceptions.SAVE16%OFFTHE ANNUAL COVER PRICEGet 12 issues <strong>of</strong> .NETDJfor only $ 69 99 !OFFER SUBJECT TO CHANGE WITHOUT NOTICEANNUALCOVER PRICE:$83.88YOU PAY$69 99YOU SAVE$13.89OFF THE ANNUALCOVER PRICE