Click here to Skip to main content
15,897,187 members
Articles / Programming Languages / C#

Scheme of Persistence

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
19 Nov 2007CDDL3 min read 23.2K   83   20  
Mapping business objects and Store Procedures
<?xml version="1.0" encoding="utf-8" ?> 
<Mapping
	Connection='workstation id=(local);packet size=4096;user id=sa;data source=(local);persist security info=True;initial catalog=Northwind;password='
	Assembly='System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
	ConnectionClass='System.Data.SqlClient.SqlConnection'>
	<WinPersistApp>
		<Class name="OrdersDetail"
			Connection='workstation id=(local);packet size=4096;user id=sa;data source=(local);persist security info=True;initial catalog=Northwind;password='>
			<Procedure 
			  Method="DetalleOrden" 
			  StoreProcedure="CustOrdersDetail">
				<InputParameters>
					<parameter Property="IdParent" ParameterBD="@OrderID" type="0"/>					
				</InputParameters>
				<OutputParameters>				
					<parameter Property="ProductName" ParameterBD="productName" type=""/>
					<parameter Property="UnitPrice" ParameterBD="unitPrice" type=""/>
					<parameter Property="Quantity" ParameterBD="quantity" type=""/>
					<parameter Property="Discount" ParameterBD="discount" type=""/>
					<parameter Property="ExtendedPrice" ParameterBD="extendedPrice" type=""/>
					<parameter Property="IDProduct" ParameterBD="ProductID" type=""/>
					<parameter Property="IdParent" ParameterBD="OrderID" type=""/>
				</OutputParameters>
			</Procedure>		
			
			<Procedure Method="ActualizaDetalle" StoreProcedure="updOrderDetail">
				<InputParameters>
					<parameter Property="IdParent" ParameterBD="@OrderID" type=""/>
					<parameter Property="IDProduct" ParameterBD="@ProductID" type=""/>
					<parameter Property="Quantity" ParameterBD="@QUANTITY" type=""/>
				</InputParameters>
			</Procedure>
			
		</Class>
		
		<Class name="Orden">
			<Select>
				<Query>
					Select * from orders
				</Query>
				<Parameters>
					<parameter Property="OrderID" ParameterBD="orderID" type=""/>
					<parameter Property="OrderDate" ParameterBD="orderDate" type=""/>
					<parameter Property="RequiredDate" ParameterBD="requiredDate" type=""/>
					<parameter Property="ShippedDate" ParameterBD="shippedDate" type=""/>
				</Parameters>
			</Select>
			<Procedure Method="Ordenes" StoreProcedure="CustOrdersOrders"
			Connection='workstation id=(local);packet size=4096;user id=sa;data source=(local);persist security info=True;initial catalog=Northwind;password='
			Assembly='System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
			ConnectionClass='System.Data.SqlClient.SqlConnection'>
				<InputParameters>
					<parameter Property="CustomerID" ParameterBD="@CustomerID" type="0"/>
				</InputParameters>
				<OutputParameters>
					<parameter Property="OrderID" ParameterBD="orderID" type=""/>
					<parameter Property="OrderDate" ParameterBD="orderDate" type=""/>
					<parameter Property="RequiredDate" ParameterBD="requiredDate" type=""/>
					<parameter Property="ShippedDate" ParameterBD="shippedDate" type=""/>
				</OutputParameters>
			</Procedure>
			
			<Procedure Method="ActualizaOrden" StoreProcedure="updOrder">
				<InputParameters>
					<parameter Property="OrderID" ParameterBD="@OrderID" type=""/>
					<parameter Property="RequiredDate" ParameterBD="@RequiredDate" type=""/>
					<parameter Property="ShippedDate" ParameterBD="@ShippedDate" type=""/>
				</InputParameters>
			</Procedure>
		</Class>
	</WinPersistApp>
</Mapping>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Web Developer
Mexico Mexico
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions