ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  Dot Net Code  >>  ASP.NET Code
 
 


 

 
 ASP.NET Code interview questions  ASP.NET Code Interview Questions
 VB.NET Code interview questions  VB.NET Code Interview Questions
 C Sharp Code interview questions  C Sharp Code Interview Questions
 ADO.NET Code interview questions  ADO.NET Code Interview Questions
Question
how to convert Dataset to Object Array or list in c# .net
 Question Submitted By :: Kris
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to convert Dataset to Object Array or list in c# .net
Answer
# 1
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 ?    0 Yes 0 No
Sona
 
  Re: how to convert Dataset to Object Array or list in c# .net
Answer
# 2
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 ?    0 Yes 0 No
San
 
 
 
  Re: how to convert Dataset to Object Array or list in c# .net
Answer
# 3
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 ?    0 Yes 0 No
Mohan
 

 
 
 
Other ASP.NET Code Interview Questions
 
  Question Asked @ Answers
 
What do you create for easier access of data? NIIT2
Code for a Simple Way to Write XML in .NET (XmlTextWriter)  1
how to upload a photo? i need to use it in a matrimonial applicaton...  1
Code for Sending E-Mail with System.Web.Mail?  1
How to get the row index on checking a Checkbox in a ListView  1
how can we close a web page in asp.net without using jscript?  1
how to convert Dataset to Object Array or list in c# .net  3
Give coding for Exception Handling Techniques in ASP.NET? Microsoft3
How we implement the paypal in my website and how we make a payment through Credit Card.  2
how to design a ListView control?  1
what is the value that reside in a hidden field when no value is assigned to it?how it can be used in a if statement??  1
How to send e-mail from an ASP.NET application? TCS10
How to Create Scrollable Micro Windows?  2
Give coding for Implementing a Fixed GridView Header in ASP.NET?  1
working with fileUpload ?  1
Code for Getting Information About A File?  1
How to add checkbox to datagrid?  4
How to Export Data to Excel? Eastcom-Systems3
Data Reader Vs DataSet TCS1
how to upload an excel in c# ASP.Net?  2
 
For more ASP.NET Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com