NetTiers generates methods for custom stored procedures that require nullable parameters

When generating methods for custom stored procedures using NetTiers all the paramters of Int, Decimal, etc get defined as Int32?, Decimal? as nullable parameters.

NetTiers says,

The problem is that a param of a stored procedure is always nullable.  You can’t have it not accept a null, you can however, have it use a default value.  So CodeSmith’s AllowDbNull property on the object is always true.
CSPUseDefaultValForNonNullableTypes, set that to true, and it will attempt to use see if the DefaultValue is not = NULL, then it will not make it a regular value type.  This of course only works for value types.

So the fix was to edit the template and
in section #07. CRUD – Advanced
change the value for CSPUseDefaultValForNonNullableTypes to True.
Advertisement

About irtazaali
Project Manager, Application Developer, and Technical Consultant in a wide variety of business applications. Particularly interested in project and product development using C#.NET, ASP.NET, XAML, Visual Basic with datastores like XML, SQL Server, Oracle, and MySQL. Always interested in migration projects and ventures in product development. Have 12 years experience in commercial software product development. Quite knowledgeable in ROI and infrastructure development operations. Have previously worked as project manager-software products at US and UK based companies providing business intelligence software solutions. Hold MCSD.NET, OCP, and OCA certifications.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.