| |

VerySource

 Forgot password?
 Register
Search
View: 1535|Reply: 12

Ask someone to write a .NET stored procedure. I don't know where to start ...

[Copy link]

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-3-14 21:30:01
| Show all posts |Read mode
The function is to determine whether the data already exists in the database`

Update count + 1 if available

If not, insert data

The syntax of my .net calling stored procedure has not been understood, so ask for help
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-12 08:15:01
| Show all posts
C#`
Reply

Use magic Report

0

Threads

20

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 LAN

Post time: 2020-6-12 13:00:01
| Show all posts
Boss, do you want a stored procedure, or call a stored procedure, or both
^^^^^^^^^^^^^^^^^^
Bangding
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-12 21:00:01
| Show all posts
The stored procedure does not matter C# and VB, both are SQL SERVER
Write successfully, call with C#

Do it with a name

create proc proc1
@prod_id varchar(10)
as
if exists(select prod_id from prod where prod_id = @prod_id)
--Perform update operation
begin
update prod set num = num + 1
end
else
- Perform an insert operation
begin
insert into prod(prod_id,num) values(@prod_id,1)
end
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-13 10:45:01
| Show all posts
All`

Are stored procedures written in SQL?

Is the write call in the .CS file?
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-13 14:00:01
| Show all posts
I don’t quite understand where to write the stored procedure ofpengw1015?

SQL?

Can .NET be called by itself?

Amazing
Reply

Use magic Report

0

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-6-13 20:30:01
| Show all posts
Stored procedures are written in SQL language, not C#
Can be called with C#
Supportpengw1015solution
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-15 12:45:01
| Show all posts
Give an example
I have a table and the table has 2 columns
Key varchar(50)
Count int

I have a method in the .CS file
protected void Sea(string key)
{
   //Here I need to use this key to substitute in the database to find if the Key column has this key or Count+1
   //If not, insert a new key
}

I can't write the middle part. "Everyone, please help me write it." Let me know the meaning of it. I don't want to never."
Reply

Use magic Report

0

Threads

17

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-6-15 23:15:01
| Show all posts
Stored procedures are written in the database.
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-19 17:45:01
| Show all posts
pengw1015


Why is your statement showing an error in my SQL
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