📄 codestructure_net.htm
字号:
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table.</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">SelectAll</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table14">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When the stored procedure <b>[SP prefix]<i>TableName</i>_SelectAll</b> is generated.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>DataTable</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>A DataTable object with all the rows selected.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>For calling the stored procedure <b>[SP prefix]<i>TableName</i>_SelectAll</b>.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>Table / View Name</i> class. This method is part of the ICommonDBAccess interface.
When this method is not generated in the table / view class, the virtual method <i>SelectAll</i>, declared in the
[Class prefix]DBInteractionBase class, is still present, but is an empty method.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table and View</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">SelectAllW<i>ForeignKeyField</i>Logic</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table8">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When the stored procedure <br><b>[SP prefix]<i>TableName</i>_SelectAllW<i>ForeignKeyField</i>Logic</b> is generated.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>DataTable</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>A DataTable object with all the rows selected.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>For calling the stored procedure <br><b>[SP prefix]<i>TableName</i>_SelectAllW<i>ForeignKeyField</i>Logic</b>.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>Table / View Name</i> class. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>Depends on table or view. See comment block generated above method declaration header for an exact list of
needed properties plus for a list of properties which are affected by a succesful call. In general:
the property corresponding to the field <i>ForeignKeyField</i>.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table.</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">Activate</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table15">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When 'Include COM+ services support code' is checked on the <a href="gui_netcode.htm">.NET Code tab</a>.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>void</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>Not applicable.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>Overrides System.EnterpriseServices.ServicedComponent.Activate. See that method for details about where Activate
is used for.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>DBInteractionBase</i> class. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table and View</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">Deactivate</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table16">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When 'Include COM+ services support code' is checked on the <a href="gui_netcode.htm">.NET Code tab</a>.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>void</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>Not applicable.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>Overrides System.EnterpriseServices.ServicedComponent.Deactivate. See that method for details about where Deactivate
is used for.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>DBInteractionBase</i> class. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table and View</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">CanBePooled</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table18">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When 'Include COM+ services support code' is checked on the <a href="gui_netcode.htm">.NET Code tab</a>
plus the user has checked 'Include Object Pooling support'.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>bool (C#) or Boolean (VB.NET)</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>True. This means the object can be pooled. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>Overrides System.EnterpriseServices.ServicedComponent.CanBePooled. See that method for details about where Activate
is used for.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>DBInteractionBase</i> class. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table and View</td>
</tr>
</table>
<br clear="all"><br>
<b class="SmallHdr">Dispose</b>
<table width="100%" cellpadding="2" cellspacing="0" border="1" ID="Table17">
<tr>
<td valign="top" width="140"><b>When generated</b></td>
<td>When 'Include COM+ services support code' is <b>not</b> checked on the <a href="gui_netcode.htm">.NET Code tab</a>.
When that options <i>is</i> checked, Dispose is available, since the [Class prefix]DBInteractionBase class is
derived from System.EnterpriseServices.ServicedComponent, which implements System.IDisposable.Dispose.
</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type</b></td>
<td>void</td>
</tr>
<tr>
<td valign="top" width="140"><b>Return Type desc.</b></td>
<td>Not Applicable</td>
</tr>
<tr>
<td valign="top" width="140"><b>Purpose</b></td>
<td>Implementation of System.IDisposable.Dispose.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Declared where</b></td>
<td>[Class prefix]<i>DBInteractionBase</i> class. </td>
</tr>
<tr>
<td valign="top" width="140"><b>Parameters</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Properties needed</b></td>
<td>None.</td>
</tr>
<tr>
<td valign="top" width="140"><b>Table / View</b></td>
<td>Table and View</td>
</tr>
</table>
</p>
<h4>.NET Code layout</h4>
<p>
<b class="SmallHdr">VB.NET or C#?</b><br>
Allthough .NET gives the developer the oppertunity to mix languages, it's often nice to have all code in your
solution in one language. The generated code by LLBLGen is meant to be extended, so when this code is in another
language than the one the rest of the project is written in, this can be a problem. LLBLGen supports C# and VB.NET
as output languages. In both cases, LLBLGen will emit code that should work the same, thus will have the same
interface and behaviour.
<br><br>
<b class="SmallHdr">More on the .NET base class [Class prefix]DBInteractionBase.</b><br>
LLBLGen generated code uses an abstract base class which is used to derive all the .NET classes from.
This abstract base class is created with extensibility in mind, so developers can add code which is common for all
generated .NET classes to this base class without any hassle with the other generated code. This abstract base class
also contains, when selected, COM+ attributes so all table .NET classes will inherit these COM+ services settings.
When GAC registration is necessary for COM+ enabled services, LLBLGen will generate AssemblyInfo statements into
the abstract base class for the COM+ application name and the .snk filename. These statements are commented out.
LLBLGen will emit the common definitions of types needed in the complete namespace in the base class' file:
the .NET base class will contain the definition of the <a href="ref_icommondbaccess.htm">ICommonDBAccess interface</a>,
plus it will contain a definition of an enum, LLBLError, which is used in all .NET code classes. By default, it
contains just one value, AllOk, but you can extend this enum with your own error codes, which you can return from
the stored procedures generated (when you extend them too) and this way you can test reported error codes from the
stored procedures in your higher level code, on a more friendlier way than simply test for '-1', for example.
<br><br>
<b class="SmallHdr">More on the properties for each tablefield</b><br>
Per .NET class, thus per table or view, LLBLGen will generate per field used in one or more stored procedures, one property
with get/set code. The type of the property depends on the type of the field, but is always one of the
System.Data.SqlTypes types, see <a href="ref_types.htm">SQLServer, .NET type relations</a> for more details.
All properties have check-code to avoid violations of limits of the used type. Each generated method needs a certain
amount of properties set and will set zero or more properties when succeeded. When the option to generate .NET code
comments is selected (recommended), LLBLGen will generate comments which show which properties are required for
each generated method. When you use C# as the output language you can use the C# documentation generation feature
of Visual Studio or other 3rd party tools like NDoc to extract a handy API documentation with this information.
</p>
<p>
<b class="SmallHdr">Naming scheme of .NET classes</b><br>
LLBLGen will use a standard for naming the generated classes and files for these classes. The class names follow this
rule: [Class Prefix]<i>Table / View name</i>. Example: for the table <i>my table</i> and prefix <i>C</i>, the class will be called:
<i>CMytable</i>, thus without the space. The filename for .NET classes is generated following this rule: [Classname].[cs|vb].
</p>
<h4>App.config / web.config</h4>
<p>
When the user selects 'Using a definition in an app.config file' under 'Connection string retrieval settings' on the
<a href="gui_netcode.htm">GUI: .NET code tab</a>, LLBLGen will generate an App.config file which will contain one
XML element, called 'Main.ConnectionString', under the <appSettings> tag. To succesfully use the generated data-access
tier, add this App.config file to the project which <i>uses</i> the generated data-access tier assembly. When that project
is a webproject, there is a Web.config file already present for that project, so you should add the Main.ConnectionString
element to an <appSettings> tag of the Web.config file. If the appSettings tag isn't present yet, you should add
that tag inside the <configuration> tag.
</p>
<div align="right" class="SmallFontTOC">
<hr size="1" width="60%" align="right">
LLBLGen v1.21 documentation. © 2002-2003 <a href="http://www.sd.nl/" target="_blank">Solutions Design</a>
</div>
<br><br><br>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -