| |

VerySource

 Forgot password?
 Register
Search
Author: zuoshou

sql server failed to find the stored procedure

[Copy link]

0

Threads

34

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2021-3-5 13:00:01
| Show all posts
declare @CardNumber varchar(50)
DECLARE @sql NVARCHAR(2000)
set @CardNumber='1.2.3.4'
   set @CardNumber ='''' + replace(@CardNumber,'.',''',''') +''''
select @CardNumber
SET @sql ='select 1 where'''+'1'+''' in ('+ @CardNumber +')'
exec (@sql)

----->This can be found
Reply

Use magic Report

3

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2021-3-5 13:15:01
| Show all posts
How do you write the parameters in the previous program? Are there any errors?
CardData cards = new CardData();
this.ViewState["Card Number"] += this.CardNumberTextBox.Text +"," + ".";
string[] ary = this.ViewState["Card Number"].ToString().Split(',');
foreach(string s in ary)
{
if(s.Trim() != "")
{
using (CardAccess ca=new CardAccess())
{
cards = ca.GetCardByNumber(s);
}
}
}
Reply

Use magic Report

3

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2021-3-5 15:15:01
| Show all posts
The above is a bit unclear, look at this
CardData cards = new CardData();
this.ViewState["Card Number"] += this.CardNumberTextBox.Text +"," + ".";
string[] ary = this.ViewState["Card Number"].ToString().Split(',');
foreach(string s in ary)
{
if(s.Trim() != "")
{
using (CardAccess ca=new CardAccess())
{
cards = ca.GetCardByNumber(s);
}
}
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list