Hi, what is the method need to use the SetDatawithReturn in WebAPI?
@wenhua17083 жыл бұрын
In the video from 5:50 t0 6:05, the use cases of SetData and SetDataWithReturn are explained. SetData is used when the stored procedure inserts/updates a record/ records in the database with no returns while SetDataWithReturn is used when the stored procedure inserts/updates database records and returns some sort of info, e.g., with select max(ID) from Employee, that gives you the newly inserted employee ID, or anything else you need to send back that meet your business needs. Hope this helps.
@parkjeongbak66783 жыл бұрын
Hello, i dont have problem with HttpGet but I dont know why I cant use HttpPost and HttpPut. Can you help me? I have stored procedure to update name and email in table. And I follow your httpput then db.setData(storedprocedure, parameters). And i try to run in postman the end point of localhost/api/values/updateinfo/{id} if gives me status 405. Please help me
@parkjeongbak66783 жыл бұрын
The query is something like this UPDATE TABLE SET NAME =, EMAIL=,
@wenhua17083 жыл бұрын
You can set breakpoint in your put method right before try, then F10 through your code till it reaches the catch, check the error message inside the catch and the cause of the error. If you can’t get into the put method at all, make sure you select put in postman, and try again. Hope this helps.
@alfredmukonda25063 жыл бұрын
Can i have implementation on more than 1 XML Node
@wenhua17083 жыл бұрын
I think you asked about the input parameter for stored procedure. The answer is yes. you may want to check with docs.microsoft.com/en-us/sql/t-sql/xml/xml-data-modification-language-xml-dml?view=sql-server-ver15 for further info.
@parkjeongbak66783 жыл бұрын
Hello, i have a question. How can i run this web api on live? Do i need to build this as exe or just like how a website works? Sorry if this is out of topic.
@wenhua17083 жыл бұрын
You can follow this video kzbin.info/www/bejne/r5Tcoo2Lopxgpas to consume the API. Once you are done with the video you should be able to develop some data driven content rich websites yourself.
@besho8894 жыл бұрын
i get this error can you help me please "expects parameter '@id', which was not supplied"
@besho8894 жыл бұрын
Create PROCEDURE [dbo].[Employees_NamesS] @id int AS Select Employee_ID ,Employee_Name_IN_English From Employee where Employee_ID = @id this is my procedure
@wenhua17084 жыл бұрын
I believe that you define @id as input parameter of your stored procedure. If you change to @xmlparm as indicated in Dal.cs, the error should be gone. you can define a stored procedure as follows just for the sake of testing. create procedure [dbo].[uspGetProductAll3d] @xmlparm xml as BEGIN select 1 as ID, 'A Content' as Content, 'AUser' as LogonID union select 2 as ID, 'B Content' as Content, 'AUser' as LogonID union select 3 as ID, 'C Content' as Content, 'AUser' as LogonID union select 4 as ID, 'D Content' as Content, 'AUser' as LogonID union select 5 as ID, 'E Content' as Content, 'BUser' as LogonID union select 6 as ID, 'F Content' as Content, 'BUser' as LogonID union select 7 as ID, 'G Content' as Content, 'BUser' as LogonID END; Once you get through this creating API business, you can modify your SP to do whatever you want. I use xml as input for most of my SPs. It is super convenient since it can carry a great deal of structured data into the SP for you to easily consume. SQL Server makes xml manipulation easy.
@wenhua17084 жыл бұрын
Try this: -- --execute Employees_NamesS N'123' -- create procedure [dbo].[Employees_NamesS] @xmlparm xml as begin Select Employee_ID ,Employee_Name_IN_English From Employee where Employee_ID = @xmlparm.value('(/parameters/id)[1]','int'); end; go
@harishussain90033 жыл бұрын
Can you please share Stored Procedure
@wenhua17083 жыл бұрын
Hope you found the Stored Procedure in my reply to Besho Refaat.
@AmanRajpootTech3 жыл бұрын
Your screen viability is not good..you should zoom ur screen size
@MumtazAli-xp7jz3 жыл бұрын
video is not visible :(
@wenhua17083 жыл бұрын
I have no problem to play the video in the States.
@sohailecp3 жыл бұрын
@@wenhua1708 he want to say that ....user can't see text