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
Olaide Azeez
1.7k
67
12.9k
Retrieving Multiple data in web service
Jul 17 2016 10:19 AM
The code below refers: How can I display the result in gridview at the consumer site.
public class dclinic
{
public string ddays { get; set; }
public string dperiod { get; set; }
}
[WebMethod]
public List<dclinic> clinicPeriod(string clinic)
{
string sq = "select Days,Period from clinicperiod where clinic = @clinic";
gap.Open();
SqlCommand cq = new SqlCommand(sq, gap);
cq.Parameters.AddWithValue("@clinic", clinic);
SqlDataReader reader = cq.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(reader);
gap.Close();
List<dclinic> rlist = new List<dclinic>();
for (int i = 0; i < dt.Rows.Count; i++)
{
dclinic dcc = new dclinic();
dcc.ddays = dt.Rows[i]["days"].ToString();
dcc.dperiod = dt.Rows[i]["period"].ToString();
rlist.Add(dcc);
}
return rlist;
}
Reply
Answers (
2
)
How to get LinkedIn like and share counts using webservices
Retrieving Multiple data in web service