小编Rob*_*ban的帖子

Escape;(分号)在app.config文件中的odbc连接字符串中

我创建了一个包含某些字段的窗体.我试图通过ODBC DSN连接与oracle数据库进行交互.

我在app.config中的以下连接字符串中有一个问题.

在连接字符串中,密码包含分号(此处为abc; 45).我收到一个错误:

"Format of the initialization string does not conform to specification starting at index 35"

而我正在尝试使用访问此连接字符串

OdbcConnection connection = new OdbcConnection(connection_string);

在C#代码中.

下面是我的连接字符串.

<add name="ConnectionString_T1" connectionString="DSN=CLA_T5;Uid=abc;Pwd=abc;45" providerName="System.Data.Odbc" />

 OdbcConnection connection = new OdbcConnection(connection_string);
Run Code Online (Sandbox Code Playgroud)

PS:我尝试将此密码用双引号/单引号/".但没有用.仍然面临这个错误.我已经尝试将所有转义序列放在",双引号,单引号,/"等.

c# string

9
推荐指数
3
解决办法
1万
查看次数

在 ASP.NET MVC 中为视图初始化模型的不同方法

当使用这两种不同的方式为视图声明模型时,ASP.NET MVC 控制器中的实际内存/性能增益是多少?

User user = userService.GetByID(id);
return View(user);
Run Code Online (Sandbox Code Playgroud)

或者

return View(userService.GetById(id));
Run Code Online (Sandbox Code Playgroud)

我假设最后一个性能更好,因为我们没有初始化对象,但是第一个更具可读性。这在拥有数千名访问者的网络服务器上是否重要?

c# memory asp.net-mvc performance

3
推荐指数
1
解决办法
2218
查看次数

Jquery代码未执行

我目前正在学习jQuery.我在使用以下代码时遇到了一些问题.我试图让我的网站使用一些按钮移动,但一旦我点击它们似乎不起作用.下面是我的jquery代码.

jQuery(document).ready(function ($) {
    //initialise Stellar.js
    $(window).stellar();
    //Cache some variables
    var links = $('.navigation').find('li');
    slide = $('.slide');
    button = $('.button');
    mywindow = $(window);
    htmlbody = $('html,body');
    //Setup waypoints plugin
    slide.waypoint(function (event, direction) {
        //cache the variable of the data-slide attribute associated with each slide
        dataslide = $(this).attr('data-slide');
        //If the user scrolls up change the navigation link that has the same data-slide attribute as the slide to active and
        //remove the active class from the previous navigation link
        if(direction === 'down') …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

1
推荐指数
1
解决办法
118
查看次数

标签 统计

c# ×2

asp.net-mvc ×1

javascript ×1

jquery ×1

memory ×1

performance ×1

string ×1