小编Son*_*ner的帖子

存储过程中的T-SQL游标

我正在使用存储过程,我想使用游标插入新数据(如果数据存在,我想更新)

ALTER Procedure [dbo].[conn]
    @ResellerID int,
    @GWResellerID int,
    @UserName varchar(50),
    @Password varchar(50),
    @URL varchar(100),
    @ServiceType int,
    @ServiceDesc varchar(50),
    @FeedFrom bit,
    @PublicKey varchar(max)
AS
    declare gateway cursor for
         select * 
         from reseller_profiles 
         where main_reseller_ID = @ResellerID

    OPEN gateway

    FETCH NEXT FROM gateway INTO @ResellerID

    WHILE @@FETCH_STATUS = 0
    BEGIN
       INSERT INTO [dbo].tblGatewayConnection([ResellerID],[GWResellerID], [UserName], [Password], [URL], [ServiceType], [ServiceDesc],[feedFromMain], publicKey)
       VALUES (@ResellerID, @GWResellerID, @UserName, @Password, @URL, @ServiceType, @ServiceDesc, @FeedFrom, @PublicKey)

       FETCH NEXT FROM gateway INTO @ResellerID
    END

    CLOSE gateway
    DEALLOCATE gateway
Run Code Online (Sandbox Code Playgroud)

我的表名tblGatewayConnection …

sql-server stored-procedures cursor

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

QueryString不显示Asp.net中的所有文本

我有下面的网址,

http://localhost:34349/page.aspx?RUD=Pby0lPWu+dc=
Run Code Online (Sandbox Code Playgroud)

如果我在page.cs加载方法中使用下面的代码

 string result = Request.QueryString["RUD"].ToString();
Run Code Online (Sandbox Code Playgroud)

结果显示低于值

Pby0lPWu dc=
Run Code Online (Sandbox Code Playgroud)

Request.QueryString中缺少" + "字符.我在asp.net中使用查询字符时完全错过的地方?

c# asp.net

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

异常停止在asp.net mvc中运行

的Global.asax.cs:

protected void Application_Start()
{
    AreaRegistration.RegisterAllAreas();    
    WebApiConfig.Register(GlobalConfiguration.Configuration);
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);

    GlobalFilters.Filters.Add(new HandleErrorAttribute()); // i added this 
}

protected void Application_Error(object sender, EventArgs e)
{
    Exception exception = Server.GetLastError();
    Response.Clear();

    HttpException httpException = exception as HttpException;

    if (httpException != null
    {
        string action;
        switch (httpException.GetHttpCode())
        {
            case 404:
                // page not found 
                action = "HttpError404";                    
                break;
            case 500:
                // server error
                action = "HttpError500";
                break;
            default:
                action = "General";
                break;
        }
    }

    // clear error on server
    Server.ClearError();

    //return new EmptyResult(); …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc exception

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