This project is read-only.

Lib4Net.Data

1.configuration

<appSettings>
    <!--type of database(mssql|oledb|oracle|mysql|sqlite)-->
    <add key="dbtype" value="sqlite"/>
    <!--class name of dataaccess(namespace.classname) depend IDAL-->
    <!--MSSqlDAL,OracleDAL,OleDBDAL,SQLiteDAL-->
    <add key="typeName" value="Lib4Net.Data.MSSqlDAL"/>
  </appSettings>
  <connectionStrings>
    <!-- connectionstring (name same as dbtype-value in appSetting ) -->
    <add name="mssql" connectionString="server=.;database=AccountBook;uid=sa;pwd=sa"/>
    <add name="oledb" connectionString="~/App_Data/AccountBook.mdb"/>
    <add name="oracle" connectionString="Data Source=AccountBook;User Id=sa;Password=sa;"/>
    <add name="mysql" connectionString="server=.;database=test;uid=sa;pwd=sa"/>
    <add name="sqlite" connectionString="Data Source=~/App_Data/Account.db;"/>
  </connectionStrings>

2.using

using Lib4Net.Data;
    IDAL idb = DALFactory.GetInstance();
    string sqlAccess = @"SELECT * FROM  tuser";
    DataTable dt = idb.ReturnDataTable(sqlAccess);

 

Last edited May 16, 2011 at 2:32 AM by sobne, version 1

Comments

No comments yet.