- 积分
- 767
- 在线时间
- 1122 小时
- 主题
- 3
- 注册时间
- 2013-6-9
- 帖子
- 273
- 最后登录
- 2024-1-21
- 帖子
- 273
- 软币
- 11235
- 在线时间
- 1122 小时
- 注册时间
- 2013-6-9
|
发表于 2014-2-19 15:45:13
|
显示全部楼层
XAF 连接数据库使用的是一个字符串。默认是在app.config或者web.config中。
以下是一个实例:
- static void Main()
- {
- #if EASYTEST
- DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
- #endif
- //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN");
- //Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN");
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
- WsdSolution1WindowsFormsApplication winApplication = new WsdSolution1WindowsFormsApplication();
- // Refer to the http://documentation.devexpress.com/#Xaf/CustomDocument2680 help article for more details on how to provide a custom splash form.
- //winApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen("YourSplashImage.png");
- if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null)
- {
- winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
- }
- #if EASYTEST
- if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) {
- winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
- }
- #endif
- try
- {
- winApplication.Setup();
- winApplication.Start();
- }
- catch (Exception e)
- {
- winApplication.HandleException(e);
- }
- }
复制代码 |
评分
-
查看全部评分
|