Click here to Skip to main content
15,911,896 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hello sir ,
I have a problem sir I create a window form in this I have many text box,and combo box, sir I want to create the web service for this form to save the value in database table but sir I create the web method in ".asmx" form then I not found the text box intelisense. I want to create the method for insert the the values in database, and I want to call this method to button_click
  [WebMethod]

    public void saleslead()
    {
        SqlConnection con = new SqlConnection("Data Source=WHIZ-48\\SQLEXPRESS;Initial Catalog=George;User ID=sa;Password=net@123");
        con.Open();
        SqlCommand cmd = new SqlCommand("insert into SalesLead values("")",con);
        cmd.ExecuteNonQuery();
        
    
    }
}

Sir In this insert command we here want to text box for user run time enter the values and save data in database table .
please give me solution.
Thanks sir
Arvind kumar singh

[Edited]Code is Wrapped in "pre" tags[/Edited]
Posted
Updated 10-Apr-11 19:23pm
v5
Comments
RaviRanjanKr 11-Apr-11 1:18am    
Always use "Pre" tags to wrap your code.

You need to add a reference to the web service proxy so that you can call it in your source code.
Tihs[^] could help you.
 
Share this answer
 
v2
Go there[^] to read the CP article which focusing how to Consuming Web Services from a Win Forms Application.
 
Share this answer
 

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