欢迎大家光临【无师自通-教程网】您的到来是我们的荣幸。本站提供photoshop教程,ps教程,flash教程,cad教程,网页制作教程,excel教程,asp教程,vb教程,3d教程,c语言教程,html教程,coreldraw教程,dreamweaver教程,java教程,3dmax教程 等各种教程为主题的内容和服务,相信您会在这里找到您所需要的东东。无师自通伴您一生-谢谢您的光临!!
网站地图 设为首页
简繁切换 加入收藏
栏目待定 留言本站
您现在的位置: 无师自通-教程网 >> WEB开发 >> ASP.NET教程 >> .NET Framework >> 教程正文

  没有公告

教程: ASP.NET教程-.NET Framework-Websharp使用说明 更多...
教程: ASP.NET教程-.NET Framework-Websharp使用说明

the dataprotection interfaces for the cache.

-->

<DataProtectionInfo AssemblyName="Microsoft.ApplicationBlocks.Cache"

ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.DefaultDataProtection"

ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAFnssQJr00KUNhRso MpLVwAinGep6i14X9M A=="

Validation="SHA1"/>

<!-- STORAGE SETTINGS

Use StorageInfo to set the assembly and class which implement

the storage interfaces for the cache.

Modes: InProc, OutProc

-->

<StorageInfo AssemblyName="Microsoft.ApplicationBlocks.Cache" ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCacheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />

<!--StorageInfo AssemblyName="Microsoft.ApplicationBlocks.Cache" ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SqlServerCacheStorage" Mode="InProc" ConnectionString="user id=sa;password=msljkdv1;Network=DBMSSOCN;DATABASE=cacheab;SERVER=msljksrv02" Encrypted="true" Validated="true" ApplicationName="Sports" RemotingUrl="tcp://localhost:8282/CacheService" /-->

<!--<StorageInfo AssemblyName="Microsoft.ApplicationBlocks.Cache" ClassName="Microsoft.ApplicationBlocks.Cache.Storages.MmfCacheStorage" Mode="InProc" BasePath="c:\mmfcache\" Encrypted="true" Validated="true" MmfDictionarySize="1048576" RemotingUrl="tcp://localhost:8282/CacheService"/>-->

<!--

MmfDictionarySize - It is the size (in bytes) of the dictionary object (in MmfCacheStorage) used to store the references of cache items.

-->

<!-- SCAVENGING SETTINGS

Use the ScavengingAlgorithm to set a class that will be executed when

scavenging is performed.

-->

<ScavengingInfo AssemblyName="Microsoft.ApplicationBlocks.Cache" ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScavenging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>

<!-- EXPIRATION SETTINGS

Use the ExpirationCheckInterval to change the interval to check for

cache items expiration. The value attribute is represented in seconds.

-->

<ExpirationInfo Interval="1" />

</CacheManagerSettings>

<WebsharpExpirationPolicy>

<ExpirationPolicy ExpirationCheckInterval="60" AssemblyName="Microsoft.ApplicationBlocks.Cache" ClassName="Microsoft.ApplicationBlocks.Cache.ExpirationsImplementations.SlidingTime" />

</WebsharpExpirationPolicy>

</configuration>

2、 系统持久化配置信息

配置PersistenceProperty,对于Web应用系统,可以在Global.asax中配置,对于Windows应用程序,可以在程序初始化时设置。

下面是设置的一个例子:

PersistenceProperty pp=new PersistenceProperty();

pp.ConnectionString="server=127.0.0.1;uid=sa;pwd=;database=logisticsDemo;";//数据库连接字符串

pp.DatabaseType=DatabaseType.MSSQLServer; //数据库类型

pp.MapFileLocation=@"WebsharpTestLib,WebsharpTestLib.xml"; //XML定义文件的路径

pp.MapFileLocationTye=MapFileLocationType.Assembly; //XML文件路径的类型

pp.UserID="sa"; //数据库用户名,必须与数据库连接字符串中的用户名一致

pp.Password=""; //数据库用户密码,必须与数据库连接字符串中的用户密码一致

ApplicationConfiguration.DefaultPersistenceProperty=pp; //设置应用程序的默认配置属性

配置信息的说明如下:

1) 数据库连接字符串、用户名和密码的设置按照常规设置

2) MapFileLocationTye指明XML映射文件的路径类型,可以有三种类型:

a) AbsolutePath:采用绝对路径的形式,在这种情况下,MapFileLocation设置成绝对路径的形式,如:“d:\apppath\xml”。

b) VirtualPath:对于Web应用程序,可以设置为虚拟路径的形式,如“/MyWebApp/EntityDefinitions/”。

c) Assembly:XML文件作为资源文件被编译。采用这种形式,需要将XML文件的生成操作属性设置成“嵌入的资源”,这种情况下,MapFileLocation的格式为:“AssemblyName,NameSpace”。例如,XML文件位于WebsharpTestLib项目的xml文件夹下面,MapFileLocation可以设置为:“WebsharpTestLib,WebsharpTestLib.xml”

附1:Websharp主要接口定义:

PersistenceCapable:

public interface PersistenceCapable

{

EntityData EntityData{get;set;}

int ObjectCount{get;}

void AddNew();

bool Next();

void First();

}

PersistenceManager:

public interface PersistenceManager : IDisposable

{

void Close();

bool IsClosed{get;}

Transaction CurrentTransaction{ get;}

bool IgnoreCache{get;set;}

void PersistNewObject(EntityData entity);

void PersistNewObject(PersistenceCapable pc);

void UpdateObject(EntityData entity);

void UpdateObject(PersistenceCapable pc);

void DeleteObject(EntityData entity);

void DeleteObject(PersistenceCapable pc);

void Reload(EntityData entity);

void Reload(PersistenceCapable pc);

void Evict (object pc);

void EvictAll (object[] pcs);

void EvictAll (ICollection pcs);

void EvictAll ();

EntityData FindEntityDataByPrimaryKey(object id,string entityTypeName);

EntityData FindEntityDataByPrimaryKey(object id,EntityData entity);

PersistenceCapable FindObjectByPrimaryKey(object id,PersistenceCapable pc);

PersistenceCapable FindObjectByPrimaryKey(object id,Type entityType);

Query NewQuery();

Query NewQuery(string entityTypeName);

Query NewQuery(string entityTypeName,string filter);

Query NewQuery(string entityTypeName,string filter,QueryParameterCollection paramColletion);

DataAccess NewDataAccess();

}

Transaction:

public interface Transaction

{

void Begin();

void Commit();

void Rollback();

PersistenceManager PersistenceManager{get;}

}

Query:

public interface Query

{

string EntityTypeName{get;set;}

string Filter{get;set;}

QueryParameterCollection Parameters

{

get;

set;

}

string Ordering{get;set;}

bool IgnoreCache{get;set;}

EntityData QueryData();

PersistenceCapable QueryObject(PersistenceCapable ps);

EntityData LoadSubObject(EntityData entity,string subTypeName);

PersistenceCapable QueryObject(PersistenceCapable ps,string subTypeName);

EntityData LoadSubObjects(EntityData entity);

PersistenceManager PersistenceManager{get;}

bool QuerySubObjects{get;set;}

bool IsClosed{get;}

void Close ();

void Open();

}

DataAccess:

public interface DataAccess

{

#region Support Property & Method

DatabaseType DatabaseType{get;}

IDbConnection DbConnection{get;}

PersistenceManager PersistenceManager{get;}

IDbTransaction BeginTransaction();

void Open();

void Close();

bool IsClosed{get;}

#endregion

#region ExecuteNonQuery

int ExecuteNonQuery(CommandType commandType, string commandText);

int ExecuteNonQuery(string commandText);

int ExecuteNonQuery(string commandText, QueryParameterCollection commandParameters);

int ExecuteNonQuery(CommandType commandType, string commandText, QueryParameterCollection commandParameters);

#endregion ExecuteNonQuery

#region ExecuteDataSet

DataSet ExecuteDataset(CommandType commandType, string commandText);

DataSet ExecuteDataset(string commandText);

DataSet ExecuteDataset(CommandType commandType, string commandText, QueryParameterCollection commandParameters);

DataSet ExecuteDataset(string commandText, QueryParameterCollection commandParameters);

DataSet ExecuteDataset(CommandType commandType, string commandText,string tableName);

DataSet ExecuteDataset(string commandText,string tableName);

DataSet ExecuteDataset(CommandType commandType, string commandText, QueryParameterCollection commandParameters,string tableName);

DataSet ExecuteDataset(string commandText, QueryParameterCollection commandParameters,string tableName);

DataSet ExecuteDataset(CommandType commandType, string commandText,DataSet ds);

DataSet ExecuteDataset(string commandText,DataSet ds);

DataSet ExecuteDataset(CommandType commandType, string commandText, QueryParameterCollection commandParameters,DataSet ds);

DataSet ExecuteDataset(string commandText, QueryParameterCollection commandParameters,DataSet ds);

DataSet ExecuteDataset(CommandType commandType, string commandText,DataSet ds,string tableName);

DataSet ExecuteDataset(string commandText,DataSet ds,string tableName);

DataSet ExecuteDataset(CommandType commandType, string commandText, QueryParameterCollection commandParameters,DataSet ds,string tableName);

DataSet ExecuteDataset(string commandText, QueryParameterCollection commandParameters,DataSet ds,string tableName);

#endregion ExecuteDataSet

#region ExecuteReader

IDataReader ExecuteReader(CommandType commandType, string commandText);

IDataReader ExecuteReader(string commandText);

IDataReader ExecuteReader(CommandType commandType, string commandText, QueryParameterCollection commandParameters);

IDataReader ExecuteReader(string commandText, QueryParameterCollection commandParameters);

#endregion ExecuteReader

#region ExecuteScalar

object ExecuteScalar(CommandType commandType, string commandText);

object ExecuteScalar(string commandText);

object ExecuteScalar(CommandType commandType, string commandText, QueryParameterCollection commandParameters);

object ExecuteScalar(string commandText, QueryParameterCollection commandParameters);

#endregion ExecuteScalar

#region ExecuteXmlReader

XmlReader ExecuteXmlReader(CommandType commandType, string commandText);

XmlReader ExecuteXmlReader(string commandText);

XmlReader ExecuteXmlReader(CommandType commandType, string commandText, QueryParameterCollection commandParameters);

XmlReader ExecuteXmlReader(string commandText, QueryParameterCollection commandParameters);

#endregion ExecuteXmlReader

}

附2:使用Websharp中间件开发的Demo程序一份。





[5] [6] [7] [8]

上一页  [1] [2] [3] [4] [5] [6] [7] [8] 下一页

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     
     
     
     

    asp连接mysql数据库

    asp连接mysql数据库-2

    frontpage2000教程---制作主页
    免责声明!本站资料大部分来自于互联网,其版权归原作者或其他合法者所有.如内容涉及或侵犯了您的权益,请通知本人,我将尽快处理!.欢迎您的光临。
    辽ICP备07003958号
    无师自通,伴你一生-教程网