how to convert Dataset to Object Array or list in c# .net
Answers were Sorted based on User's Feedback
Answer / mohan
DataTable dt = ds.Tables[0];
List<Employee> emp = new List<Employee>();
foreach (DataRow dr in dt.Rows)
{
Employee em = new Employee();
em.Name = dr["Name"].ToString();
em.age = Convert.ToInt32(dr["Age"]);
em.Salary = Convert.ToInt32(dr["Salary"]);
emp.Add(em);
}
Is This Answer Correct ? | 13 Yes | 6 No |
Answer / san
http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/24b786da-fc87-4264-b934-5a0381ca6bdc
this one works fine.
DataTable dt = ds.Tables[0];
List<Employee> emp = new List<Employee>();
foreach (DataRow dr in dt.Rows)
{
Employee em = new Employee();
em.Name = dr["Name"].ToString();
em.age = Convert.ToInt32(dr["Age"]);
em.Salary = Convert.ToInt32(dr["Salary"]);
emp.Add(em);
}
Is This Answer Correct ? | 13 Yes | 10 No |
Answer / sona
1-->
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5b1c29e2-bf37-4dd2-be39-50d27abb188e
2-->
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/8d3834a8-2749-4bd6-a32b-f8a162a5b641
3-->
http://programming.top54u.com/post/ASP-Net-C-sharp-Convert-DataSet-to-ArrayList.aspx
4-->
http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/24b786da-fc87-4264-b934-5a0381ca6bdc
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / merca
just find here some good samples og dataset in C#
http://csharp.net-informations.com/dataset/csharp-dataset-
tutorial.htm
Is This Answer Correct ? | 2 Yes | 2 No |
how to track links visited in google using iframes
where is assembly are store
How to get the row index on checking a Checkbox in a ListView
Code for a Simple Way to Write XML in .NET (XmlTextWriter)
i have a gird with columns all are coming from database,this will bind in item templete in gridview as textboxex.and i have button below named Update.i want to update all the records in the grid,but if user change the value of one textbox,what is the easy way 2 do this
What do you create for easier access of data?
how to upload an excel in c# ASP.Net?
Data Reader Vs DataSet
Give coding for Implementing a Fixed GridView Header in ASP.NET?
How to add checkbox to datagrid?
how to create a search bar which access data from various websites and retrieves the data
Code for Presenting Parent/Child Data in a Data Grid Row?