说明:存储过程执行效率比单独的SQL语句效率高。 样编写存储过程?存储过程在SQL Server 2005对应数据库的可编程性目录下。 比如,创建一个存储过程 代码如下: create procedure procNewsSelectNewNews as begin select top 10 n.id,n.title,n.createTime,c.name from news n inner join category c on n.caId=c.id order by n.createTime <weixin_38567956> 上传 | 大小:39kb
说明:两个类: (页面数据校验类)PageValidate.cs 基本通用。 代码如下: 代码如下:using System; using System.Text; using System.Web; using System.Web.UI.WebControls; using System.Text.RegularExpressions; namespace Common { /// /// 页面数据校验类 /// public class PageValida <weixin_38731239> 上传 | 大小:54kb
说明:1.调用存储过程,但无返回值 代码如下:Private Function SqlProc1(ByVal ProcName As String) As Boolean ‘定义数据链接部分省略, myConn为链接对象 ProcName为存储过程名 Dim myCommand As New SqlClient.SqlCommand(ProcName, myConn) With myCommand .CommandType = CommandType.StoredProcedure .Paramet <weixin_38660918> 上传 | 大小:37kb