I tried with below code. Here the problem is parameters are directly passing to the database from url.But i need to send the data from Text fields.
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:@"http:UserProfile.svc/InsertUserDetailsNew?Name=RajeevLeader&FirstName=rajeev&DateofBirth=2012-02-03&Sex=M&Country=India&City=Banglore&PhoneNumber=8523898947&IncumbentonPremimum=true"]];
NSLog(@"url is %@",request);
NSString *requestString =[NSString stringWithFormat:@"Name=%@&FirstName=%@&DateofBirth=%@&Sex=%@&Country=%@&City=%@&PhoneNumber%@&IncumbentonPremimum=%@",name.text, firstname.text,dob.text,gender.text,country.text,city.text,phone.text,premiumtextfield.text];
NSLog(@" RequestString: %@",requestString);
NSMutableData *requestData =[NSMutableData dataWithBytes:[requestString UTF8String] length: [requestString length]];
[request setHTTPMethod: @"POST"];
[request setValue:@"application/x-www-form-urlencoded; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody: requestData];
NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (con)
{
NSLog(@"data sent ");
} else
{
NSLog(@"Not sent");
}
[con start];