TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Demo Cloud
NA
140
12.6k
How to consume the web api in xamarin forms?
Dec 1 2020 11:10 PM
Hello,
Below is the code for web api, I wanted to consume/call the web api in xamarin forms and bind the result to the picker.
[System.Web.Http.HttpGet]
public
HttpResponseMessage GetNames()
{
//Conectionstrings for different databases
string
client1 = ConfigurationManager.ConnectionStrings[
"client_db1"
].ConnectionString;
string
client2 = ConfigurationManager.ConnectionStrings[
"client_db2"
].ConnectionString;
string
client3 = ConfigurationManager.ConnectionStrings[
"client_db3"
].ConnectionString;
//Applying the select command for different databases
SqlConnection con =
new
SqlConnection(client1);
SqlDataAdapter da1 =
new
SqlDataAdapter(
"select provider_name,Id from Provider_details"
, con);
DataSet ds1 =
new
DataSet();
da1.Fill(ds1);
con =
new
SqlConnection(client2);
da1.SelectCommand.Connection = con;
DataSet ds2 =
new
DataSet();
da1.Fill(ds2);
con =
new
SqlConnection(client3);
da1.SelectCommand.Connection = con;
DataSet ds3 =
new
DataSet();
da1.Fill(ds3);
//Merging the database to select the provider name
ds1.Merge(ds2);
ds1.Merge(ds3);
return
Request.CreateResponse(HttpStatusCode.OK, ds1);
}
Please help me,
Thanks
Reply
Answers (
12
)
How to pass data from one Api Controller to another Api controller?
I'm fresher as xamarin developer could you please send any xamarin pro