易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net(c#) 下SQL存储过程使用详细实例

记取记录集
create procedure getArticle
as
select * from Article_Content
GO
asp.net 调用方法
  SqlConnection Conn = new SqlConnection();
        Conn.ConnectionString = Data.Connstr();
        Conn.Open();
        SqlDataAdapter sdr=new SqlDataAdapter();
        sdr.SelectCommand = new SqlCommand("getArticle", Conn);
        sdr.SelectCommand.CommandType=CommandType.StoredProcedure;
        DataSet rs = new DataSet();
        sdr.Fill(rs);
        sdr.Dispose();
        Conn.Dispose();
        Response.Write(rs.Tables[0].Rows.Count);
       
-------------------------------------------------------------------------------------
删除记录(带输入参数)
create procedure DelArticle
@Id int
as
delete from Article_Content where Id=@Id
GO
asp.net调用方法
 if (Request.QueryString["Id"] != null)
        {
            SqlConnection Conn = new SqlConnection();
            Conn.ConnectionString = Data.Connstr();
            Conn.Open();
            SqlCommand cmd = new SqlCommand("DelArticle", Conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Id", SqlDbType.Int,4).Value = int.Parse(Request.QueryString["Id"].ToString());
     &


相关文档:

ASP.NET中GridView设计汇总

Row内找Label控件
//内部控件事件
protected void LinkButton11_Click1(object sender, EventArgs e)
        {
            //删除对应的事务
            int ......

使用VB将Excel导入到Sql中

使用VB把Excel导入到Sql数据库中,其实有几种方法。
下面我介绍的这种方法,较为简单。
其实这种方法的话,是直接使用T-SQL操作的,因此,到了VB里面,直接eccute这个代码就OK了的。
-----------------------------------------------------下面是在T-sql中的语句
if object_id('NewTable') is not null/*判断表NewTabl ......

asp.net使用精灵墨林提示找不到指定模块

窗体代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AgentObjects;
using SpeechLib;
using System.Web;
using System.Threading;
using System.Text.RegularExpressio ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号