我正在使用存储过程,我想使用游标插入新数据(如果数据存在,我想更新)
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 …
我有下面的网址,
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中使用查询字符时完全错过的地方?
的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)