<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DataContext</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>Recent changes to DataContext</description><atom:link href="https://sourceforge.net/p/garlic3/wiki/DataContext/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 05 Nov 2021 15:49:24 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/garlic3/wiki/DataContext/feed" rel="self" type="application/rss+xml"/><item><title>DataContext modified by cybrarian</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -22,7 +22,7 @@
 In that application you use following libraries: MyLibrary, DataContext

 MyLibrary has:
-- `public constant csDataSet`: a string used to identify settings in the config file.
+- `public constant csDATASET`: a string used to identify settings in the config file.
 - `public hConData`: a Connection object used to connect to the database.

 DataContext knows how to store settings in the config file, and how to get them for use.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cybrarian</dc:creator><pubDate>Fri, 05 Nov 2021 15:49:24 -0000</pubDate><guid>https://sourceforge.netd487cd796198303f33ba3fd111638d90c97a5eb7</guid></item><item><title>DataContext modified by wignoxqs</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -4,6 +4,11 @@
 CDataContext knows the syntax that is used to store the settings in the config file, so setting and reading is done with CDataContext.
 Also the choice of which setting to use is kept by CDataContext (with an id in the configuration file) and the contexts can be given a name; a list of them can be asked from CDataContext.
 Create a new context with `newDataContext(`name you want to give, Optional description, optional id of choice`)` gives back the id that is created for it.
+
+You can then simply use an existing Connection object (eg hConData) that you filled with the right data to connect to the database, and make CDataContext save that to the configuration file with saveConnection(idOfContextItBelongsTo, datasetString it is saved under, Connection object); DataContexts count from zero.
+Eg: `hDataContext.saveConnection(0, "DbEmployees", hConData)`
+
+To connect afterwards:

 1. from application
 Define a constant string that is used in the configuration file, `Private Const csMyAppDataset As String = "DbMyApp"` (eg "DbEmployees")
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">wignoxqs</dc:creator><pubDate>Tue, 02 Nov 2021 14:55:29 -0000</pubDate><guid>https://sourceforge.net0f5e8ae4679ce3f1ebfeff66ef7414c4aa9e1429</guid></item><item><title>DataContext modified by wignoxqs</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -3,6 +3,7 @@
 Datacontext supplies the class CDataContext. That is used in applications that make connection to a database, and in which you want to be able to switch between databases for different circumstances like testing, developing, useing production data etc.
 CDataContext knows the syntax that is used to store the settings in the config file, so setting and reading is done with CDataContext.
 Also the choice of which setting to use is kept by CDataContext (with an id in the configuration file) and the contexts can be given a name; a list of them can be asked from CDataContext.
+Create a new context with `newDataContext(`name you want to give, Optional description, optional id of choice`)` gives back the id that is created for it.

 1. from application
 Define a constant string that is used in the configuration file, `Private Const csMyAppDataset As String = "DbMyApp"` (eg "DbEmployees")
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">wignoxqs</dc:creator><pubDate>Tue, 02 Nov 2021 14:46:17 -0000</pubDate><guid>https://sourceforge.neta6b7cbac6a18824295fd284827789b1309266e83</guid></item><item><title>DataContext modified by wignoxqs</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,12 +1,15 @@
 How to use DataContext?

-Datacontext is used in applications that make connection to a database, and in which you want to be able to switch between databases for different circumstances like testing, developing, useing production data etc.
+Datacontext supplies the class CDataContext. That is used in applications that make connection to a database, and in which you want to be able to switch between databases for different circumstances like testing, developing, useing production data etc.
+CDataContext knows the syntax that is used to store the settings in the config file, so setting and reading is done with CDataContext.
+Also the choice of which setting to use is kept by CDataContext (with an id in the configuration file) and the contexts can be given a name; a list of them can be asked from CDataContext.

 1. from application
 Define a constant string that is used in the configuration file, `Private Const csMyAppDataset As String = "DbMyApp"` (eg "DbEmployees")
 Define a connection object` hConData as New Connection`.
 Make an object from the DataContext class to manage the settings; `hDataContext As New CDataContext`
 use it like this: `hDataContext.makeConnection(hCondata, csMyAppDataset)`
+

 2. with libraries
  Suppose you have an application "myApplication".
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">wignoxqs</dc:creator><pubDate>Tue, 02 Nov 2021 14:42:50 -0000</pubDate><guid>https://sourceforge.net847397498f4d33c225e32fb32112b3b77660bb01</guid></item><item><title>DataContext modified by wignoxqs</title><link>https://sourceforge.net/p/garlic3/wiki/DataContext/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;How to use DataContext?&lt;/p&gt;
&lt;p&gt;Datacontext is used in applications that make connection to a database, and in which you want to be able to switch between databases for different circumstances like testing, developing, useing production data etc.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;from application&lt;br/&gt;
Define a constant string that is used in the configuration file, &lt;code&gt;Private Const csMyAppDataset As String = "DbMyApp"&lt;/code&gt; (eg "DbEmployees")&lt;br/&gt;
Define a connection object&lt;code&gt;hConData as New Connection&lt;/code&gt;.&lt;br/&gt;
Make an object from the DataContext class to manage the settings; &lt;code&gt;hDataContext As New CDataContext&lt;/code&gt;&lt;br/&gt;
use it like this: &lt;code&gt;hDataContext.makeConnection(hCondata, csMyAppDataset)&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;with libraries&lt;br/&gt;
 Suppose you have an application "myApplication".&lt;br/&gt;
In that application you use following libraries: MyLibrary, DataContext&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;MyLibrary has:&lt;br/&gt;
- &lt;code&gt;public constant csDataSet&lt;/code&gt;: a string used to identify settings in the config file.&lt;br/&gt;
- &lt;code&gt;public hConData&lt;/code&gt;: a Connection object used to connect to the database.&lt;/p&gt;
&lt;p&gt;DataContext knows how to store settings in the config file, and how to get them for use.&lt;/p&gt;
&lt;p&gt;In your application: &lt;br/&gt;
Define &lt;code&gt;hDataContext as New CDataContext&lt;/code&gt;&lt;br/&gt;
Use like:&lt;br/&gt;
&lt;code&gt;hDataContext.MakeConnection(MyLibrary.hCondata, MyLibrary.csDataSet)&lt;/code&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">wignoxqs</dc:creator><pubDate>Tue, 02 Nov 2021 14:35:55 -0000</pubDate><guid>https://sourceforge.netb7f058ab143133ee903bea981470a9cb4103f222</guid></item></channel></rss>