Click or drag to resize
Askia

PersistentInitDatabaseConnection Method

Initializes the connection of the main database used by AskiaCore

Namespace:  AskiaCore
Assembly:  AskiaCore (in AskiaCore.dll) Version: 6.0.0-build000000000000000000000000000000000000000001
Syntax
public static void InitDatabaseConnection(
	string accessString,
	DatabaseTypes type
)

Parameters

accessString
Type: SystemString
Connection string or path for the database, depending on the database type
type
Type: AskiaCoreDatabaseTypes
Type of the database to use
Remarks
For .NET web project you may use the Global.asax to initialise the database connection
Examples

Initialise the database connection in the Global.asax of the .NET web project

using AskiaCore;

namespace MyApp
{
    public class Global : HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            // Initialize the database connection string (Where the survey was stored)
            Persistent.InitDatabaseConnection("connectionstring", DatabaseTypes.PORTAL);
        }
    }
}
See Also