
<iframe width="100%" scrolling="no" height="100%" frameborder="no" src="about:blank" id="snap_com_shot_preview" name="snap_com_shot_preview" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 0px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: transparent; z-index: 99999;" />
<iframe scrolling="no" frameborder="no" allowtransparency="true" src="about:blank" id="snap_com_shot_spasense_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 1px; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: rgb(240, 240, 240); z-index: 99999; bottom: 29px; width: 297px; height: 39px;" />
<iframe width="265" scrolling="no" height="190" frameborder="0" src="about:blank" id="snap_com_shot_option_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 20px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: transparent; z-index: 99999; width: 298px; height: 207px;" />
<input type="button" title="Close" value="Cancel" name="cancelBtn" style="border: 1px solid rgb(153, 153, 153); margin: 0pt; padding: 0pt; background: transparent url(http://i.ixnp.com/images/btn-bkgd.gif) repeat scroll 0%; visibility: inherit; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: auto; top: 201px; line-height: normal; z-index: 99999; right: 54px; width: 50px; height: 21px; font-size: 11px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" id="snap_com_shot_option_cancel" />

<iframe width="100%" scrolling="no" height="100%" frameborder="no" src="about:blank" id="snap_com_shot_preview" name="snap_com_shot_preview" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 0px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: transparent; z-index: 99999;" />
<iframe scrolling="no" frameborder="no" allowtransparency="true" src="about:blank" id="snap_com_shot_spasense_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 1px; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: rgb(240, 240, 240); z-index: 99999; bottom: 29px; width: 297px; height: 39px;" />
<iframe width="265" scrolling="no" height="190" frameborder="0" src="about:blank" id="snap_com_shot_option_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 20px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.26.1/t.gif); background-color: transparent; z-index: 99999; width: 298px; height: 207px;" />
<input type="button" title="Close" value="Cancel" name="cancelBtn" style="border: 1px solid rgb(153, 153, 153); margin: 0pt; padding: 0pt; background: transparent url(http://i.ixnp.com/images/btn-bkgd.gif) repeat scroll 0%; visibility: inherit; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: auto; top: 201px; line-height: normal; z-index: 99999; right: 54px; width: 50px; height: 21px; font-size: 11px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" id="snap_com_shot_option_cancel" />

<iframe width="100%" scrolling="no" height="100%" frameborder="no" src="about:blank" id="snap_com_shot_preview" name="snap_com_shot_preview" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 0px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.22.9/t.gif); background-color: transparent; z-index: 999999;" />
<iframe scrolling="no" frameborder="no" allowtransparency="true" src="about:blank" id="snap_com_shot_spasense_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 1px; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.22.9/t.gif); background-color: rgb(240, 240, 240); z-index: 999999; bottom: 29px; width: 297px; height: 39px;" />
<iframe width="265" scrolling="no" height="190" frameborder="0" src="about:blank" id="snap_com_shot_option_iframe" style="border: 0pt none ; margin: 0pt; padding: 0pt; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: 0px; top: 20px; line-height: normal; background-image: url(http://i.ixnp.com/images/v2.22.9/t.gif); background-color: transparent; z-index: 999999; width: 298px; height: 207px;" />
<input type="button" title="Close" value="Cancel" name="cancelBtn" style="border: 1px solid rgb(153, 153, 153); margin: 0pt; padding: 0pt; background: transparent url(http://i.ixnp.com/images/btn-bkgd.gif) repeat scroll 0% 50%; visibility: inherit; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: absolute; left: auto; top: 201px; line-height: normal; z-index: 999999; right: 54px; width: 50px; height: 21px; font-size: 11px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" id="snap_com_shot_option_cancel" />
Introduction
This article describes how to set-up an ASP.NET project in order to use MySql as its session state store provider.
Using the code
Looking
on the web I was not able to find a suitable solution that uses MySql
as its session state store. It may certainly be possible that there is
already a better solution available (if so, please do not hesitate to
contact me). However, I was able to find a sample session state store
provider using MS Access. That's it! Port it to MySql ... and that's
what I did.
But, let's do it step by step. The list below gives you an idea on what I did in order to get it to work:
- Downloaded the sample session state store provider for MS Access from MSDN.
- Downloaded the .NET Connector (using version 5.0.7) from MySql.
- Ported the sample code provided by Microsoft for use with MySql (the zipped source code can be found here).
- Adjusted the Web.config accordingly:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="MySqlSessionServices" connectionString="Database=<name of database>; Data Source=<host>; User Id=<login>; Password=<password>"/>
</connectionStrings>
<system.web>
<sessionState cookieless="false" regenerateExpiredSessionId="true" mode="Custom" customProvider="MySqlSessionProvider">
<providers>
<add name="MySqlSessionProvider" type="Samples.AspNet.Session.MySqlSessionStateStore" connectionStringName="MySqlSessionServices" writeExceptionsToEventLog="false"/>
</providers>
</sessionState>
</system.web>
</configuration>
You can check it out at www.kimpel.com ... it works like a charm
.
Please do not hesitate to contact me if you have any questions and/or comments.
History
2007-09-20: initial version
2007-10-17: updated link to sources
<script type="text/javascript" src="http://i.ixnp.com/shot_main_js/v2.26.1/"></script><script type="text/javascript" src="http://shots.snap.com//snap_shots.js?ro=1&ap=1&tc=0&tp=1&hdd=1500&si=0&key=38278c431bc885d2e8b29b587e4c5d90&th=silver&sb=1&link_icon=on&shots_trigger=both&size=small&lang=en-us&campaign=addon_ff_1.3.0&plugin=1"></script>