data not post through webservice json in ios
<p>i am post the data using webservie but data is not post into database.` </p>

<pre><code>    NSURL *url = [NSURL URLWithString:@"some url"];
    NSArray *res=[[NSArray alloc] initWithObjects:txtname.text, nil];
    NSError *jsonError;
    //NSJSONSerialization is Apple's new json serialization class so we can use it to convert to and from json and foundation objects
    NSData *requestdata = [NSJSONSerialization dataWithJSONObject:res options:0 error:&amp;jsonError];


    NSMutableURLRequest *request;
    request = [NSMutableURLRequest requestWithURL:url];
    [request setHTTPMethod:@"POST"];
    [request setValue:[NSString stringWithFormat:@"%d", [requestdata length]] forHTTPHeaderField:@"Content-Length"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:requestdata];

    //this kicks off the request asynchronously
    NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

`
</code></pre>
