Registration Form WEB API Using Stored Procedure In MVC asp.net 4.6

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends welcome to my channel this is Sharon in this video I will show you using store procedures how to create a new user registration form in Web API and consume in RAM BC and here we got the output of the index view page they had attacks before enter any values and inserting the data and here the validation data under shunts are working perfectly let's enter new user details Sharon the password is two three one two three are Manning and the repast four one two three four and the password and we password is not matching Sharon and gmail.com the email ID the gender male and the metal status is married in the joined it is seven twenty first insert this record see here we got an error message confirm password and password do not match so let's add the Val valid password one two three and three password is also one two three both are same and the gender is male the marital status is married the joint it is this one now before incidents recalled that certain the database table a table his new user edge I'm exhibiting the table and here we got the results of this table new user range right now which contains 0 rows let's insert the records insult so here we got a message the user cheran assailed successfully let's check in the editors table I am exhibiting the same table I can execute so here we got the username Chan is inserted successfully let's hire another record digital and earning Meanor password is abc' the password is 'abc my password is ABC calm since female and she's unmarried the joining did is 7 21 2009 teen and such and here we got a message the user Mina a sealed successfully let's in the database never execute and here we got the Mina is added successfully into this table new years of age they have implemented if you are a first-time visitor to my channel please subscribe to get the latest updates before writing the coding pattern Arab API first we'll create a new table and stir procedure and SQL Server management studio I'm expanding the root folder as well as our databases notice in the databases there is new TV which is my user database I want to create a new table and stir procedure in this new DVD reverse that me expand is new DB right click the new DB reverse new coil no not cited pirate to create a table filled table new user words as a table a column names our user ID which is an integer type not now I'm adding primary key for this column and this column is the identity identity 1 comma 1 the second one is a user name the second column name is and bath cap 150 the third column name is a password and that 153 password and 150 email and the next one I'm adding a gender which is a CAD data type marital status and about that and the last column name I'm adding joined it which is added column dead data that that's it let's execute to create a table execute here regalame says command completed successfully let's expand this tables folder the table name is refresh the tables folder and here we got a table new use of action let me browse a table select authors of those and here we got the results of the newly created table new use of wedge which contains fight null 0 rows now let's create a stored procedure to insert the data into this table using Web API and the same data was new TB there is a programmable tip folder expand upon the stored procedures that click the store procedure select news to procedure and here we got the default store procedure call I'm building the position name and adding master position name is SP user his master procedure name and the parameters are adding at let me explain this new user license I can see the columns what we have username and 150 at password and back 150 at password and that 150 at email and vanta 150 at gender and back at 150 it's a cat type solid is bad data type marital status Stardust and laughs cat and the last column name is a joint edge which is a data adapter so now we'll add the insert statement into the store procedure insert into a table name is a new user wedge a new user reg which contains a column username password read password email [Music] title status and the last one is a join get various I am adding these parameters at username trauma at password at a rate password at email the next column named parameters agenda at marital status and the last one is a join it that said we have added the insert statement let's create the stirred procedure execute and hear God the message command completed successfully if a sister procedures refresh then expand the stored procedures folder and here we got the SPU's average is added into our store procedures for that up to now we have just finished the first part we have created the table and the stop procedure you know let's go open visual studio and create a new web API application and MSA for this video tutorial I'm creating a new web API application go to file new cause act from the web templates I'm selecting a sweet dart net web application and the dotnet framework I'm using 4.6.1 the application name is using stored procedure in embassy is my project name click ok and from the asp.net campus I'm selecting web api click OK and the project is created successfully let's close this default window that's open solution Explorer hi first in this project I'm adding LD word dot indented a moral life took the project name ad ad would donate entity data model let's view the item name the model name user wedge click OK and from the model contents I'm selecting the first option click Next let's create a new SQL server connection new connection I'm adding s column after adding server name now I'm selecting the database name we have created the table and store procedure in this new TV delivers that self at bar new DB after that it's just the test connection is succeeded ok ok and here we got our connection string and the connection string name is a new TV entities and I'm saving this connection string in the web config file put it next and from the database objects and expanding the tables folder as well as tbo our table name is new user well let's have that one and this is a table name new user edge after that come to the bottom there is a stored procedures and functions folder expand that one as well as a DB you also 1st or procedure name is SP user edge and selecting that one also so have selected the table and the store procedure then could finish and the entity model is a little project that's closest output message box after adding the entity model now I right-click the entry model add neo served the function import let's select the stir procedure the function name is a SPE Sahaj and notice in the entities there is a table name new user edge now let's add a function input name is user registration as a function name click okay and here we got in a model browser known is the stop position SP use average and user registration both are added in two rows both are added after that open solution Explorer let's minimize the references folder let's create a class in his models folder right-click the models folder add class let's give the class name user new user is a fastener now in this new user class I'm defining only the public properties and the data initials functionality which is a validation it's at the namespace using system dot component neural data on oceans after that in public class I'm adding the public properties public string a user name get set public sing password jet set public sting read password that such public sting email get such public Genda get set here the gender and the table allow Arab the datatype for gender is a towel so I'm adding here also tell the next one is a public string and the last one is have joined it which is a big time with a type enjoying did get such so after adding the public properties knots time to add please his plane name is a constant user name x1 is a possible enter the password display name password and didn't type and bigger type dot password enter the confirm password the label of the confirm password is a confirm password and the data type and my name the password type and next Anderson and Adam confirm companies compare between double quotes and comparing this confirm password this password so both possible and three password must be same otherwise abused another the next one email please and an email the label name is email for the gender I'm adding the radio button values please select the label name is a gender and the next one for the marital status I'm adding the drop down control so please status the liberal name is a inaudible status and the last one please sir the ditch is under the dead and the label name is a joint date that's it we have added the public prevalence and the data inertia in this new user browser now the next step of in solution explorer let's add a new web api in this controllers folder that click the compose folder add controller I am selecting that API to control of Mt add let's cue the controller name is and here we got the web api controller which is a user wedge now in this controller and adding us using the project name dot models folder after that and the prepare controller I am adding public public I assertive action result in and this add new user I'm adding the table learn which is the new user verge its greater object and you his object name I'm adding my connection string entity name new DB entries and E is equals to new new DB and arrays and the dot I am adding the stir procedure name our store procedure name is SP you so much let's add that one SP and this SP you service takes the parameters the string username password we password email general matter status and joint it Manning and you is an object dot user username dot password and new dot V password and you dot email and new dot gender and new dot marital status and knew God joined it after adding the entities now I'm selling the data and edad cell changes matter once I sell the changes and adding return ok method except the hell added the call to insert the values using stock procedure and this Web API controller now before adding the MVC controller to this part first we'll get out this Web API controller URL Google Chrome got the output of the project which is a homepage now they required a web URL after the domain name local horse forward slash I'm earning API forward slash that's at the web prepare controller name which is a use of edge this is a API control of name and and here we got the results of this Web API URL they've got some error message the requester resource does not support HTTP method get' because we are posting the DAT out so don't worry about this error message we just require this web URL so I can switch back to the coding part we'll add a MVC controller to consume the web api stop debugging no open solution Explorer again the same controllers folder right-click the controllers and select the controller now this time I'm selecting a Miss if a controller empty and the controller name is rich is a controller name and you've got our controller new user - now in this controller first and adding the namespaces using the project name dot models folder after that to consume the Web API for that I'm using as - typical I'm so I'm adding the namespaces using system dotnet dot HTTP namespace now in the controller I'm adding one more action result index file HTTP POST a city big boost when this action result index I'm adding my class name new user class this class name a state altered and you'll see in this action result class a certificate right it says ulster new HTTP client that's it god this address is equals to no you are this your method takes a parameter string so swing is double quotes let's add the web URI this URL add that one semicolon after we got the babby URL now let's insert the data variable insert data is equals to it's dot both as Jason a sink I'm adding the class name new use of edge and the method takes two parameters the first one is sing the question so you can double quotes are Manning the control of name user wedge the second parameter is AB value new user class value which is a object man aeneas semicolon recent data [Music] variable SIL data is equals to insert data dot result if served at a dot is such a status car but the record is saved successfully into database I want to display the message for that I'm using view bad you back dot surgery system user but in this Christmas I'm adding the object and you see dot the user name is so successful that's it we have added the call so after that the action result index if model state that is valid this if condition I am adding for the validation the controls that's it we have consumed the web api in this controller and also we have implemented the data on oceans functionality now we require the index view page before adding the view page to this project we must build the application fast build build solution and here we got a message build succeeded let's close this awkward message box now select the actions of index let that one right click the mouse add view the bunam is index on the tamborim selecting cleared because we're inserting the data so have selected the time that create after that the morale class I'm selecting the the input function name which is a new user wedge I'm not adding this class name I have added the functional data context class is a new dependent as a whole connection surname and here we got the index pupils now fast in this index repairs I'm changing the title after that I'm adding the center I'm closing the center tag after the headers index and changing the index using stroke procedure how to conjure that's API in MVC extreme NBC that API tutorials after that and adding positive life so after adding the headers in horizontal line and notice here in the password field the God here the editor file HTML helper instead of elder for earning the password the same thing I'm adding for every password now in the gender huh I'm adding the radio button controls and stuff editor father's equals two name is equals to at HTML dot name father and this name for methyl and adding the moral degenerate and the value is equals to M M is for real Scott this one yes yeah and this one for every male now I don't require is fine and in the marital status I'm earning the drop-down list so select options are running option values close to the first option value is empty selector disable the first option I am adding the label marital status after that I am adding some items to do to the stables one is a married the second one is unmarried the third one is divorce the fourth one is breeder now the select I'm adding name is equal store at HTML dot name father I'm adding the model the whole that Morris no I don't require this one and the final stop once the record is inserted successfully I want to display the message but that in controller we have added the viewbag dot message so I'm passing this message from controller to view pĂȘche using message at view back that message and I'm changing this value of the label is in such that's it we have done the complete coding part we got the ad whoa entity model the table and store procedure the model class the Web API controller MVC controller and the final one is an index view page now before on this application the most important we must change the control of name open solution Explorer in the process there is an app and Scott's top fold and expand that one what conflict that says file open that one and notice here the controller is a home just into that one our controller name is new user edge controller I'm adding a Missi control of name which is a new user copy this one and paste in the under part and the action result is the index which is a index of your page that's it let's check the results Google Chrome and here we got the output of the industry page they had attacks before enter any values and inserting the data and here the validation data under shunts are working perfectly let's enter new user details Sharon the password is two three one two three I'm adding and the repass wall one two three four and the password entry password is not matching Sharon and gmail.com the email ID the gender male and the metal status is married in the joined it is 720 fast because the 19 insert this record see here we got an error message confirm password and password do not match so let's add the Val Val it possible one two three and three password is also one two three both are same and the gender is male the marital status is married the joined it is this one now before incidence recall that certain the database table a table is new user edge I'm executing the table and here we got the results of this table new user range right now which contains zero rows let's insert the records in such so here we got a message the user Cheran is sealed successfully let's check in the editors table I'm executing the same table I can execute so here we got the username Chan is inserted successfully let's hire another record this turn and adding meaner password is abc' the password is abc' see and gmail.com sis female and she's unmarried the joining that is 7 21 2010 and such and here we got a message the user Mina a sealed successfully let's check in the database table execute and here we got the Mina is added successfully into this table new years of age they have implemented we have implemented using stroke procedure to consume web api in MVC that's it
Info
Channel: Haritha Computers & Technology
Views: 7,583
Rating: undefined out of 5
Keywords: call web api mvc, web api stored procedures, web api tutorials
Id: d74VzudI36I
Channel Id: undefined
Length: 35min 2sec (2102 seconds)
Published: Tue Jul 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.