You are here: Re: Create XML in ASP.NET 2.0 then use for joined table in SQL Server 2005 Stored Procedure « MsSQL Server « IT news, forums, messages
Re: Create XML in ASP.NET 2.0 then use for joined table in SQL Server 2005 Stored Procedure

Posted by Erland Sommarskog on 06/11/06 08:55

news.sbcglobal.net (groomeryNOSPAM@MAPSONsbcglobal.net) writes:
> I'm developing an ASP.NET 2.0 application that has a user select one or
> more auto manufacturers from a listbox ("lstMakes"). Once they do this,
> another listbox ("lstModels") should be filled with all matching models
> made by the selected manufacturers. If lstMakes was not multi-select,
> I'd have no problem. But in this case it has to be multi-select. The
> database is SQL Server 2005 which does not accept arrays as parameters.
> I've been told that I have to create an XML document that will act as a
> filtered Manufacturers table that I can join to my Models table in my
> stored procedure. Problem is I don't have the foggiest idea how to do
> this. I've seen some examples that just leave me scratching my head so
> I was hoping someone could look at what I'm trying to do and show me how
> to do this. Thanks!

The good news is that XML is just one way to skin the cat, so if you
don't know how to create XML documents, you can sleep over that part
for now. Look at
http://www.sommarskog.se/arrays-in-sql.html#iterative for what is the
simplest method.

However, for more comlpex scenarios where you need to send down an
"array" of structure data, XML is the best apparoch. So you may want
learn how to form XML documents for future use anyway.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация