Cafalse Visitor

Free counters!

Like On Facebook

Monday, July 1, 2013

SkySE The Alternative Database Connection

SkySE is new alternative Database connection Framework simple and FREE! to use.
SkySE support for Oracle,MySQL,MSSQL + secure your server / connection string in your web.config 
SkySE also have internal Encrypt/Decrypt with added few algorithm to make it hard to crack (maybe :p) 

TRY NOW Full Example source : SkySE

WEB.CONFIG setting;

<add key="DbType" value="2"/>
<add key="errEmptyRow" value="no data"/>
<add key="errEmptyTable" value="invalid query"/>
<add key="sys_error" value="This is Error for public user sample, You can edit this in web.config."/>
<add key="ServerPort" value="#port if any"/>
<add key="ServerIP" value="DB instance"/>
<add key="ServerUsername" value="DB username"/>
<add key="ServerPassword" value="DB Password"/>
<add key="ServerDataSource" value="DB Datasource"/>
<add key="SysFormatDate" value="dd/mm/yyyy"/>
<add key="GlobalParamKey" value="f_"/>
<add key="GlobalParamType" value="f_g,f_p,f_s,f_r,f_wc,f_wa,f_f"/>
<add key="CompanyName" value="#NEED TO REG."/>
<add key="ProductKey" value="#NEED TO REG."/>
<add key="DEVKey" value="#NEED TO REG."/>
<add key="DEVServer" value="NO/YES"/>

DbType

DB Type :
  1. [Default] As Integer = 0
  2. db_MSSQL As Integer = 1
  3. db_MySQL As Integer = 2
  4. db_Oracle As Integer = 3
  5. db_CustomDB As Integer = 4

errEmptyRow,errEmptyTable,sys_error

Static error msg to be appear when error in Database Execution

GlobalParamType

Have f_g,f_p,f_s,f_r,f_wc,f_wa,f_f (7) flexi parameter (array ordered), This parameter must be unique. You can change this parameter depend on your needs.
Like : MyAps_a,MyAps_b,MyAps_c,MyAps_d,MyAps_e,MyAps_f .... etc.
but This "GlobalParamKey" must change to "MyAps_"
Example:
URL: localhost/mypage.aspx?MyQueryString=Testing

Dim f As New SkyFunction.Misc
Textbox1.text = f.ParamConverter("{f_g:MyQueryString}")
Result will look like Textbox1.text = "Testing"

Lets say you have session name "USERLOGGED" and value = "ADMIN" You can also use like this :
Dim db As New SkyDB.MasterDB(SkyDB.DBType.db_MSSQL)
Dim ds As New Data.DataTable
ds = db.DataTable(" select * FROM MY_TABLE where ABC='{f_g:MyQueryString}' and DEF='{f_s:USERLOGGED}'")
You Result will look like select * FROM MY_TABLE where ABC='Testing' and DEF='ADMIN'

Array:
  1. Array(0) : f_g refer for GET (Query String) Method
  2. Array(1) : f_p refer for POST (form item) Method
  3. Array(2) : f_s refer for SESSION Method
  4. Array(3) : f_r refer fer GET (form item) Method
  5. Array(4) : f_wc refer for Web.Config (Configuration Section)
  6. Array(5) : f_wa refer for Web.Config (AppSetting Section) Method
  7. Array(6) : f_f refer for Reading file in server (use streaming)

ProductKey,DEVKey

This is needed when to make your app more secure
This SkySE have internal encryption with complexity method encryption / decryption
Let say your connection string will be like this.
  <connectionStrings>
    <add name="YourConnectionString" connectionString="Data Source=.\mssql2008;Initial Catalog=MyDB;User ID=[enc]gN5frVjjKKQFZe+yRCqpOg==[/enc];Password=[enc]Xp+1vOrxcNJv84WlOtTeTkgwl2r/WkSLIAcpWHyJPNga0mQejbnaxw==[/enc];Max Pool Size=1024;Pooling=true;" providerName="System.Data.SqlClient"/>
     </connectionStrings>


So in this case you only need to declare just like this :
Dim ds As New SkyDB.MasterDB(SkyDB.DBType.Default, "{f_wc:YourConnectionString}")
you also can use for :
<add key="ServerUsername" value="[enc]EncryptionValue[/enc]"/>
<add key="ServerPassword" value="[enc]EncryptionValue[/enc]"/>
<add key="ServerDataSource" value="[enc]EncryptionValue[/enc]"/>
REMEMBER! Different ProductKey and Dev Key will be different encryption value
This key is free for 5 DevKey key
if you need more just email us @ support[at]cafalse.com
To Encrypt / Decrypt

DEVServer

This is to confirm if this code was publish into you development server, please set it as "YES", if you set is as "NO"
SkySE will assume you as Development Server if any error upon database execution happen, skyse will go into debug mode
and error detail will appear in current page. if you set it as "YES" SkySE will throw this error <add key="sys_error" value="This is Error for public user sample, You can edit this in web.config."/>
if you don't want skyse throw any error then just leave it blank.

Open Downloaded folder -> goto BIN folder ->
Copy SkySE DLL add as reference in your project :) 

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger