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
Nandhini Jayachandran
NA
117
43.4k
getting only 1 value
Jun 1 2014 2:00 AM
public List login(string salesmanname, string usercode)
{
List customers = new List();
con.Open();
using (SqlCommand cmd = new SqlCommand("Select Id, CompanyRefId from SalesMan where salesmanname=@salesmanname and code=@usercode", con))
{
cmd.Parameters.AddWithValue("@salesmanname", salesmanname);
cmd.Parameters.AddWithValue("@usercode", usercode);
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
customer c1 = new customer();
c1.id = (int)reader["Id"];
c1.companyrefid = (Guid)reader["CompanyRefId"];
customers.Add(c1);
}
return customers;
}
}
}
this is the code i have used but i am getting only id value and not companyrefid while returning in list .how to get both ?.using break point i checked i am getting id value and companyrefrid.
Reply
Answers (
2
)
Datatable cell to list & using string list in Legends
Code Required to put data in text box on selection of cmbbx