正则表达式,看看最后一个字符是'U'还是'C'(Regex to see if last character is 'U' or 'C')
我正在编写一个Acrobat Professional DC自定义预检配置文件,我需要在其中检查专色名称是否以“U”或“C”结束。
正则表达式可以解决这个问题吗?
I am writing an Acrobat Professional DC custom Preflight profile in which I need to check if the spot colors names finishes with either 'U' or 'C'.
Can a regex solve this?
原文:https://stackoverflow.com/questions/37357664
更新时间:2023-07-30 15:07
最满意答案
正如您所发现的那样,输出参数难以使用。 (至少我是这么认为的。)从存储过程的外观来看,@ RecordCount唯一能做的就是给你一个返回行的计数。 有一个更简单的方法来做到这一点。
从存储过程中,我将删除参数@RecordCount。 然后在你的代码中......
public DataSet GetAllJobs(BussinessObj objBussiness) { DataSet ds = new DataSet(); IDbCommand selectCommand = null; SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@Mode", "DisplayDataPaging"); param[1] = new SqlParameter("@PageIndex", objBussiness.PageIndex); param[2] = new SqlParameter("@PageSize", objBussiness.PageSize); ds = objDataAccess.ExecuteDataset(_spName, param); objBussiness.RecordCount = ds.tables(0).rows.count; return ds; }
我相信你知道,DataSet可以包含一个DataTable数组。 存储过程只返回一个记录集,或一个表。 这样就可以访问该表:
ds.tables(0)
这使您可以访问该表中的所有行:
ds.tables(0).rows
这会为您提供表中的行数。
ds.tables(0).rows.count
如果这对您有用,请告诉我。
谢谢!
Change
@RecordCount INT output
to
@RecordCount int=null output
相关问答
更多-
过程或函数“”需要参数'',它没有提供(Procedure or function “” expects parameter '', which was not supplied)[2023-05-15]
非常简单和容易:您的存储过程需要两个参数 - @ParameterName和@ParameterValue - 但您的调用仅提供一个 ... 你应该这样调用你的存储过程: DECLARE @ParameterValue varchar(50) EXEC Getparameterdefaultvalues @ParameterName = 1, @ParameterValue = @ParameterValue OUTPUT PRINT 'Result is: ' + @ParameterValue ... -
我会检查我的应用程序代码,看看你设置@template的价值。 我怀疑它是空的,其中存在问题。 I would check my application code and see what value you are setting @template to. I suspect it is null and therein lies the problem.
-
正如您所发现的那样,输出参数难以使用。 (至少我是这么认为的。)从存储过程的外观来看,@ RecordCount唯一能做的就是给你一个返回行的计数。 有一个更简单的方法来做到这一点。 从存储过程中,我将删除参数@RecordCount。 然后在你的代码中...... public DataSet GetAllJobs(BussinessObj objBussiness) { DataSet ds = new DataSet(); ...
-
过程或函数“”需要参数'',它没有提供(Procedure or function “” expects parameter '', which was not supplied)[2022-06-05]
在这种情况下创建你的proc CREATE PROCEDURE [dbo].[TempUpdateMerchantCategories_Insert] ( @LocationID BIGINT, @PrimaryID INT, @SecondaryID INT, @ImageID BIGINT = null) 这将使ImageID成为可选参数 create your proc like this in that case CREATE PROCEDURE [dbo].[TempUp ... -
更改以下两行: command.Parameters.Add(@username,SqlDbType.VarChar,50).Value=username; command.Parameters.Add(@password, SqlDbType.VarChar,50).Value=password; 有: command.Parameters.Add("@Username",SqlDbType.VarChar,50).Value=username; command.Parameters.Add("@Pas ...
-
你省略了: myCommand.CommandType = CommandType.StoredProcedure; 因此,发送到DB的命令是错误的sp_executeSQL调用,而不是所需的exec login FYI还有一个更短的语法: myCommand.Parameters.Add("@Abc", SqlDbType.Int).Direction = ParameterDirection.Output; You have omitted: myCommand.CommandType = Comm ...
-
过程或函数''期望参数''未提供[重复](Procedure or function ' ' expects parameter ' ' which is not supplied [duplicate])[2022-11-17]
出错的原因是SqlCommand类需要纯文本SQL 。 分配存储过程名称 (在您的情况下为"dbo.MyProcedure" )添加 ... // Do not forget to Dispose IDisposable instances using (SqlCommand cmd = new SqlCommand("dbo.MyProcedure", connection)) { // cmd.CommandText is a stored procedure name, not ... -
首先,正如迈克提到的,你应该与参数命名保持一致。 例如 SqlParameter SubscriptionId = new SqlParameter("InventoryPushSubscriptionId", SqlDbType.Int); 应该 SqlParameter SubscriptionId = new SqlParameter("@InventoryPushSubscriptionId", SqlDbType.Int); 然后正如@NSGaga指出的那样,你并没有真正将参数传递给命令,你只 ...
-
您正在使用sp_executesql来运行SQL文本dbo.SaveResults 。 这个T-SQL运行没有参数的程序dbo.SaveResults 。 现在您了解该消息的来源。 该怎么办? 使用EXEC : EXEC dbo.SaveResults @resultID = 1234, @positiveResults = @p3 或者,嵌套电话: exec sp_executesql N' EXEC dbo.SaveResults @resultID = @resultID, @positi ...
-
由于所有过程参数都是必需的,因此有两种方法可以正确调用它: 1) 直接 (不推荐) EXEC dbo.stp_DespatchedJob 1,2,1,1,1,1,1'ctrl',7 2) 使用命名参数 (推荐) EXEC [dbo].[stp_DespatchedJob] @jobId = 1, @DriverId = 2, @HasPda = 1, @enablePda = 1, @IsAdvanceJob = 1, @IsAutodespatchedJob = 1, @Con ...