4
CREATE  FUNCTION [dbo].[PMURP_Func_ParseArray] (@Array VARCHAR(1000),@separator CHAR(1))
RETURNS @T Table (ExtractWords varchar(50))
AS 
BEGIN
--DECLARE @T Table (col1 varchar(50))
-- @Array is the array we wish to parse
-- @Separator is the separator charactor such as a comma
DECLARE @separator_position INT -- This is used to locate each separator character
DECLARE @array_value VARCHAR(1000) -- this holds each array value as it is returned
-- For my loop to work I need an extra separator at the end. I always look to the
-- left of the separator character for each array value

SET @array = @array + @separator

-- Loop through the string searching for separtor characters
WHILE PATINDEX('%' + @separator + '%', @array) <> 0 
BEGIN
-- patindex matches the a pattern against a string
SELECT @separator_position = PATINDEX('%' + @separator + '%',@array)
SELECT @array_value = LEFT(@array, @separator_position - 1)
-- This is where you process the values passed.
INSERT into @T VALUES (@array_value) 
-- Replace this select statement with your processing
-- @array_value holds the value of this element of the array
-- This replaces what we just processed with and empty string
SELECT @array = STUFF(@array, 1, @separator_position, '')
END
RETURN 
END

Select Description from Bad_Names WHERE Description in (Select * from dbo.PMURP_Func_ParseArray('bala',' '))

Description,Name_ID
PK_BadNames nonclustered, unique, primary key located on PRIMARY    Description
4

4 回答 4

8

在我的情况下,我有一个导致此错误的<form></form>内部。<form></form>

于 2014-03-03T02:28:28.707 回答
2

我对这个错误的问题与 Tuyen Nguyen 回答有关——另一个表单标签内的一个表单标签。

在使用 Bootstrap 模式对话框 div 时——表单的部分视图的容器——

<div id="modal-container" class="modal fade" tabindex="-1" role="dialog">

我错误地将模态容器 div 放置在导致脚本 5007 错误的 @using Html.BeginForm 语句标签中。

将它放在 Html.BeginForm 的大括号之外会使错误消失

@using (Html.BeginForm("Edit", "Home", FormMethod.Post))
{

 }
于 2015-03-27T19:17:15.147 回答
1

当我们尝试在不是实际表单元素的元素上调用 validate() 时,我们得到了这个错误。前任: $('div#entryForm').validate()

当我们更改 jQuery 选择器以选择根表单元素时,我们没有遇到任何问题:

$('form#form1').validate()
于 2013-09-16T18:25:40.723 回答
0

Anyone using Knockout js?

I know its an old post, but first result in Google when I searched. So, in case this might help someone else... for me it was calling the $(form).validate() prior to applying the knockout bindings.

I had the validate call in with the form I was loading for a dialog box, so it was running on load and then knockout model was being applied. I moved the validate call into a dialogReady function and then called it after knockout - problem solved.

于 2014-01-16T15:48:44.100 回答