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
Kobinath Ram
NA
130
0
how to display 7 days of week weather forecast in c#
Oct 11 2017 1:19 AM
I have tried this code many times. below code but getting Error.
this is the API used to get the 7 days week forecast. in below I entered the city "London".so I can get the 7 days forecast report of London.
http://api.apixu.com/v1/forecast.xml?key=5742bec32f4141e08db171907171010&q=london&days=7
when I write the code in c#. instead of London, I passed the one textbox control.because the country which I entered in the textbox.the particular country is 7-day forecast will be displayed at grid view. this is the code I tried
string city = txtcity.Text;
string uri = string.Format("http://api.apixu.com/v1/forecast.xml?key=02d3de968c424e20b5a74149172409 &q=" + city + " &days=7");
I strucked at this point. I don't know how to pass the textbox name within URL.
the final result has to be displayed on the grid view control. I tried the code below. 7 days forecast will have to display on the grid view.
XmlReader xmlFile;
xmlFile = XmlReader.Create(uri);
DataSet ds = new DataSet();
ds.ReadXml(xmlFile);
dataGridView1.DataSource = ds.Tables[1];
please, anyone, help me to solve this problem
Reply
Answers (
3
)
Windows Mobile Device Application with Windows CE
assign textbox value to label