Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello friends
I want to insert values into database using webService. I tried searching but i did not get any proper info. please help!!
Posted
Updated 14-Apr-11 10:54am
v2
Comments
Perry Bruins 14-Apr-11 15:48pm    
What kind of database? Oracle? Sql? mySQL? is it a WCF service? in short: there is not enough information to play with...
Noel3090 14-Apr-11 16:22pm    
Sql database. Its simple asp.net web service

Here is an option:
Overview of Native XML Web Services for Microsoft SQL Server[^]

Regards
Espen Harlinn
 
Share this answer
 
This link[^] might help you.
 
Share this answer
 
You Need to create One WebMethod in WebService
which will interact to you DataBase

[WebMethod]
        public Void InsertItems(string FirstName)
        {
            try
            {

            }
            catch (Exception ex)
            {
            }
            finally
            {
            }
        }




after Creating Your Method you need to add the reference of it in your web application

Then you need to create an Object of that webservice
Like

  Webervice.MyWebservice Obj = new Webervice.MyWebservice()

          Obj.//Here You will get your Method that is 'InsertItems()'
and then you just need to pass your Parameters to that like 

 obj.InsertItems(txt_FirstName.text);
 
Share this answer
 
Comments
Noel3090 18-Apr-11 14:52pm    
thanks mahen25
You could refer to any article in the web that discusses CRUD operations, i don't think there is a "recommended" way to do it in web services specifically. Check out the link below from MS -

http://www.asp.net/mvc/tutorials/create-a-movie-database-application-in-15-minutes-with-asp-net-mvc-cs[^]

So, for you, I feel the first step in doing what you intend would be to understand how you interact with the database. This article would certainly help you.

Hope this helps!
 
Share this answer
 
From webservice.cs you can perform Insert Operation. You can pass the value to webservice.cs by session or by parameter passing.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900