Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 562933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:36:24+00:00 2026-05-13T12:36:24+00:00

in my web application i am using datatable and inserting outlook contacts in that.

  • 0

in my web application i am using datatable and inserting outlook contacts in that.
this is my code

    DataTable myTable = new DataTable();
    DataRow dr = myTable.NewRow();
    DataColumn myDataColumn = new DataColumn();
    myDataColumn.DataType = Type.GetType("System.String");
    myDataColumn.ColumnName = "Email";
    myTable.Columns.Add(myDataColumn);        

    Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
    foreach (Microsoft.Office.Interop.Outlook.AddressList addList in oApp.Session.AddressLists)
    {

        foreach (Microsoft.Office.Interop.Outlook.AddressEntry addEntry in addList.AddressEntries)
        {
            dr["Email"] = addEntry.Address.ToString();
            myTable.Rows.Add(dr);
            dr = myTable.NewRow();
            //Response.Write(addEntry.Address.ToString());
        }

    }

My doubt is can i write the code like this
when contact is insert into mytable. the details of the row can read into a string like this

string s= myTable.Rows[0][“Email”].ToString(); in foreach

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:36:24+00:00Added an answer on May 13, 2026 at 12:36 pm

    You can use the DataRow collection of the foreach loop and get the corresponding row values.

    foreach (DataRow dr in myTable.Rows)
    {
        // Specify the column name or column index of the datacolumn
        //dr["ColumnName"].ToString();
    }
    

    or you can use a DataView of the DataTable and iterate through the DataRowView collection

    DataView dv = myTable.DefaultView;
    
    foreach (DataRowView drv in dv)
    {
        drv.Row["ColumnName"].ToString();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a web application using ASP.NET MVC that has two very distinct
I have this web application using Spring Web Flow framework. In my main page
Start a new web application using NetBeans 7 on GlassFish 3.1 In index.xhtml body
I'm developing a web application using ASP.NET MVC 3 and Entity Framework Code First
I'm writing a web application using Spring/Hibernate that displays a report to a user,
I have this ASP.Net Web Application and in one of my Pages I'm using
I made this web service that returns a datatable from sql server db. Can
I am testing a web application using Java Remote Method Invocation (RMI). When I
I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
I publish my web application using msbuild by calling following command: msbuild myweb.csproj /T:Package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.