zoukankan      html  css  js  c++  java
  • using code to set nettiers' default dataprovider dynamically


                DSP.MIS.Data.SqlClient.SqlNetTiersProvider p = new DSP.MIS.Data.SqlClient.SqlNetTiersProvider();
                System.Collections.Specialized.NameValueCollection collection = new System.Collections.Specialized.NameValueCollection();
                collection.Add("UseStoredProcedure", "false");
                collection.Add("EnableEntityTracking", "true");
                //collection.Add("EntityCreationalFactoryType", "Northwind.Entities.EntityFactory");//I think this is not an correctly code, so I remark it ,it seems okay after be remarked, noted by zy 2012-5-18

                //when I was writing the date '5-12', I remembering  the 2008 Wenchuan earthquake,expressed regret over the decedents

                collection.Add("EnableMethodAuthorization", "false");
                collection.Add("ConnectionString", "packet size=4096;user id=sa;data source=127.0.0.1;persist security info=True;initial catalog=Schuldatenbank-Local;password=Abcd1234");
                collection.Add("ConnectionStringName", "GermanSchool.My.MySettings.netTiersConnectionString");
                collection.Add("ProviderInvariantName", "System.Data.SqlClient");
                p.Initialize("default", collection);
                DataRepository.LoadProvider(p, true);

                DataRepository.Provider.ExecuteScalar(CommandType.Text, "select count(1) from Parent").ToString(); // test the provider

    悼念5.12地震中逝去的同胞 

  • 相关阅读:
    消息中间件(一)MQ详解及四大MQ比较
    WebSocket 详解教程
    Nginx 简易教程
    排序七 归并排序
    排序五 简单选择排序
    排序四 希尔排序
    排序二 快速排序
    排序一 冒泡排序
    [算法题] 人民币大小写转换(阿拉伯数字和汉字转换)
    Linux编程 18 安装软件程序(yum工具对软件包安装,删除,更新介绍)
  • 原文地址:https://www.cnblogs.com/zyip/p/2507332.html
Copyright © 2011-2022 走看看