Getting Started

Top  Previous  Next

DbNetSuite is a suite of AJAX enabled ASP.NET controls that can be used in the creation of database aware web applications.

Adding DbNetSuite to Visual Studio

To add DbNetSuite to the Visual Studio toolbox follow these steps:

 

1.If you do not already have a tab in the toolbox called DbNetSuite then right click on the toolbox panel and select Add Tab. Create a tab called DbNetSuite
2..Right click on the tab and select Choose Items.
3.In the Choose Items dialog that opens click on the Browse button
4.Navigate to the bin folder in the DbNetSuite installation folder and select the file DbNetLink.DbNetSuite.dll.
5.The DbNetSuite control is now selected in the Choose Items dialog. Click on OK to add DbNetSuite to the Toolbox

Using  DbNetSuite in Visual Studio

To use DbNetSuite  in Visual Studio simply drag one of the DbNetSuite control icons from the toolbox onto the design window and specify the ConnectionString and FromPart properties in the Properties window.

Configuration Settings

The following web.config settings relate to DbNetSuite

HttpHandlers

The following HttpHandlers must be added to your application web.config file

IIS 6 and Visual Studio Development Server

<configuration>
  ...
  <system.web>
    ...
    <httpHandlers>
      <add verb="*" path="dbnetgrid.ashx" type="DbNetLink.DbNetSuite.DbNetGrid" validate="false"/>
      <add verb="*" path="dbnetedit.ashx" type="DbNetLink.DbNetSuite.DbNetEdit" validate="false"/>
      <add verb="*" path="dbnetfile.ashx" type="DbNetLink.DbNetSuite.DbNetFile" validate="false"/>
      <add verb="*" path="dbnetspell.ashx" type="DbNetLink.DbNetSuite.DbNetSpell" validate="false"/>
      <add verb="*" path="dbnetcombo.ashx" type="DbNetLink.DbNetSuite.DbNetCombo" validate="false"/>
      <add verb="*" path="dbnetlist.ashx" type="DbNetLink.DbNetSuite.DbNetList" validate="false"/>
      <add verb="*" path="dbnetsuite.js.ashx" type="DbNetLink.DbNetSuite.JS" validate="false"/>
      <add verb="*" path="dbnetsuite.css.ashx" type="DbNetLink.DbNetSuite.CSS" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>    
    ...
  </system.web>
  ...
</configuration>  

IIS 7

<configuration>
  ...
  <system.webServer>
    ....
    <handlers>
      <add name="dbnetgrid_ashx" verb="*" path="dbnetgrid.ashx" type="DbNetLink.DbNetSuite.DbNetGrid"/>
      <add name="dbnetedit_ashx" verb="*" path="dbnetedit.ashx" type="DbNetLink.DbNetSuite.DbNetEdit"/>
      <add name="dbnetfile_ashx" verb="*" path="dbnetfile.ashx" type="DbNetLink.DbNetSuite.DbNetFile"/>
      <add name="dbnetspell_ashx" verb="*" path="dbnetspell.ashx" type="DbNetLink.DbNetSuite.DbNetSpell"/>
      <add name="dbnetcombo_ashx" verb="*" path="dbnetcombo.ashx" type="DbNetLink.DbNetSuite.DbNetCombo"/>
      <add name="dbnetlist_ashx" verb="*" path="dbnetlist.ashx" type="DbNetLink.DbNetSuite.DbNetList"/>
      <add name="dbnetsuite_js_ashx" verb="*" path="dbnetsuite.js.ashx" type="DbNetLink.DbNetSuite.JS"/>
      <add name="dbnetsuite_css_ashx" verb="*" path="dbnetsuite.css.ashx" type="DbNetLink.DbNetSuite.CSS"/>
    </handlers>
    <modules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </modules>    
    ....
  </system.webServer>
  ...
</configuration>  

System.Web.Extensions

DbNetSuite makes use of the System.Web.Extensions namespace which if you are running your web application under vn 2.0 of the .Net framework means that you must also deploy the file System.Web.Extensions.dll alongside the DbNetSuite DLL in your application bin folder. Your web.config file should also have the following line.

<configuration>
  ...
  <system.web>
    ...
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>    
    ...
  </system.web>
  ...
</configuration>  

 

Under vn 4.0 of the .Net framework the System.Web.Extensions namespace is built into the core framework so there is no need to deploy the file System.Web.Extensions.dll and your web.config file should also have the following line.

<configuration>
  ...
  <system.web>
    ...
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>    
    ...
  </system.web>
  ...
</configuration>  

Running DbNetSuite vn 2.0 under ASP.NET vn 4.0

If you are running the DbNetSuite DLL compiled with .NET 2.0 under ASP.NET 4.0 then you do not need to deploy the file System.Web.Extensions.dll but you will need to tell the .NET 2.0 DLL to use the ASP.NET 4.0 version of System.Web.Extensions by updating the web.config file as follows:

<configuration>
  ...
  <system.web>
    ...
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>    
    ...
  </system.web>
  ...
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  <runtime>
  ...
</configuration>  

ConnectionStrings

To connect DbNetSuite to your database you must add a connection to the connectionStrings section of the application web.config file. For more information on supported databases and data providers click here

<configuration>
  ...
	<connectionStrings>
		<add name="SamplesDatabase" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=~/Data/Nwind.mdb"/>
		<add name="SqlServerDB" connectionString="Server=DbServer;Database=Northwind;Trusted_Connection=true;"/>
		<add name="OracleDB" connectionString="Data Source=HUMANRESOURCES;user id=scott;password=tiger;" providerName="OracleClient"/>
		<add name="MySqlDB" connectionString="Server=DbServer;Port=3306;Database=World;User ID=root;Password=password;" providerName="MySql"/>
		<add name="OdbcDatabase" connectionString="DataProvider=ODBC;DSN=DSN_Name;"/>
		<add name="VistaDBDatabase" connectionString="Data Source=~/Data/dbnetsuitevs.vdb3;Open Mode=NonexclusiveReadWrite;"/>
	</connectionStrings>
	...
<configuration>	

DbNetSuiteTinyMCELocation

This property must be set if you want to enable the HTML editor. The property should be set to the the virtual path of the TinyMCE folder

DbNetSuiteCultureSource

Specifies if the culture should be taken from the "client" or "server".  The culture determines amongst other things how date and currency values are displayed and validated.

DbNetSuiteLicenseId

The ID of the license. Not required for evaluations.

DbNetSuiteLicenseKey

The DbNetSuite license key.

DbNetSuitejQueryNoInclude

If set to "true" will not include the jQuery library automatically. Use this option when the jQuery library is already available in the page. DbNetSuite requires at least version 1.6 of jQuery.

DbNetSuitejQueryNoConflict

If set to "true" will suppress the the jQuery $ method so that it can be used by a different library.

DbNetSuiteAntiXSS

If set to "true" will encode all output from the components using the Microsoft Anti-Cross Site Scripting Library

DbNetSuiteCheckUserToken

If set to "true" will use a server generated token to verify the validity of the request submitted to DbNetSuite from the users application. We recommend setting this option to true as it provides an additional layer of security for your applications specifically to combat CSRF (cross-site request forgery) attacks.

If you are running a client-side implementation of a DbNetSuite control then you must also include the user token by adding the line highlighted below.

<html>
<head>
<link rel="stylesheet" type="text/css" href="dbnetsuite.css.ashx"></link>
<script type="text/javascript" src="dbnetsuite.js.ashx"></script>
<%=DbNetLink.DbNetSuite.Shared.WriteUserToken()%>
<script>
jQuery(document).ready( init )
 
function init()
{
 var dbnetgrid1 = new DbNetGrid("grid1");
 with (dbnetgrid1)
 {
         fromPart = "customers"
         connectionString = "SamplesDatabase"
         initialize()
 }
}
</script>
</head>
<body>
<div id="grid1"</div>
</body>

Note that the line must follow the inclusion of the DbNetSuite client-library

<script type="text/javascript" src="dbnetsuite.js.ashx"></script>

 

if you are running the server-control implementation of DbNetSuite the token is included automatically.

Run Sample

DbNetSuiteIPAccess

Remote access to the Web Designer and Connection Manager  is disabled by default. To enabled remote access the IP address of the clients you wish to grant access should be added to this configuration key. Multiple IP addresses can be added as a comma separated list or represented as a regular expression.