Google [站内搜索]

分类: Web编程预览模式: 普通 | 列表

ASP.NET为页面某个控件单独设置外观

有时我们给一个ASP.NET页面指定使用了一个主题后,又想单独为某个控件设置外观(不使用默认外观),这时可采用的方法有两种:一是使用命名的控件外观,二是在@Page指令中使用StylesheetTheme属性来代替常用的Theme。下边使用具体实例说明下两种方法的使用:

1.使用命名的控件外观

App_Themes\Default\Default.skin:

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4363
T-SQL:

Create PROCEDURE Pro_MoreResult
AS
    --第一个结果集

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5125

C#中String和string的区别

·string是C#中的类,String是.Net Framework的类(在C# IDE中不会显示蓝色)。
·C# string映射为.Net Framework的String。
·如果用string,编译器会把它编译成String,所以如果直接用String就可以让编译器少做一点点工作。
·如果使用C#,建议使用string,比较符合规范。
·string始终代表 System.String(1.x) 或 ::System.String(2.0),String只有在前面有using System;的时候并且当前命名空间中没有名为String的类型(class、struct、delegate、enum)的时候才代表System.String。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3423

使用ildasm查看MSIL代码

微软中间语言 (MSIL) 是一种语言,是许多编译器(C#、VB.NET等)的输出。ILDasm (中间语言反汇编器)程序和.Net Framework SDK(FrameworkSDK\Bin\ildasm.exe)打包在一起,让用户以人可阅读的格式查看MSIL代码。通过该工具,我们可以打开任何.net可执行文件(exe或dll)并查看其MSIL代码。下边我们来看看怎么使用:

1.在VS2008中新建一个Windows窗体应用程序,输入如下代码后生成解决方案:
private void Form1_Load(object sender, EventArgs e)
{

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6666

int i=0;i=i++;结果解析

int i=0;
int j=i++;

对于上边的代码,大家都知道最终j=0,i=1,之前为了方便记忆,记它的口诀是先赋值再递增,以区别于j=++i(先递增再赋值),所有理解中就有了这么一个执行顺序:

int i=0;

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5997

select列表项选中

在对内容进行编辑的时候,有些内容是以列表(select)的形式显示的,为了方便编辑,我们希望上次提交的列表项能设置为选中项,以前ASP 中经常这么写:

<select name="accredit" id="accredit" style="width:100px">
    <option value="共享软件" <% If addRow("accredit")="共享软件" Then Response.Write("selected") %>>共享软件</option>
    <option value="免费软件" <% If addRow("accredit")="免费软件" Then Response.Write("selected") %>>免费软件</option>

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3901
建立池连接可以显著提高应用程序的性能和可缩放性。SQL Server .NET Framework 数据提供程序自动为 ADO.NET 客户端应用程序提供连接池(MSDN)。

Opening a database connection is a resource intensive and time consuming operation. Connection pooling increases the performance of Web/windows applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all connections currently in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.
Connection pooling behavior is controlled by the connection string parameters. Please look into MSDN documents in the reference link if you want to know further information.

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4456

"超时时间已到"解决方案

联盟平台周期性的打不开,查了下日志,错误原因都为:

引用内容 引用内容
Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4754
Create PROCEDURE Test
AS
    DECLARE @strSQL nvarchar(500)
    
    SET @strSQL = 'select mobileno,regtime into #tmpTable from textmessage'

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 8063

委托进阶:匿名方法的使用

我们现在来做一个小程序:创建一个Windows窗体应用程序,然后在默认创建的Form1上添加两个按钮,分别命名为btnClickMe1和btnClickMe2,显示的文本为“点击我1”、“点击我2”,如下图所示:



然后我们希望在点击这两个按钮的时候,能够弹出一个对话框,向用户显示一个提示,例如“您好,我的读者,希望您能喜欢本书!”(顺便一提,我是真心这么希望的^^)。如果在往常,你可能会毫不犹豫的在按钮上双击,然后编写按钮的事件处理代码,但是我们现在在讲委托和事件,所以让我们换一种方式,像下面这样修改Form1.cs文件:

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4077