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 7898479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:26:39+00:00 2026-06-03T08:26:39+00:00

I’m Looking for Code to populate a Microsoft Sql Server Database, with my email

  • 0

I’m Looking for Code to populate a Microsoft Sql Server Database, with my email inbox and i would like it to be done by a Windows service so the users don’t know its happening.

How do i get my windows service to populate my Database?

My Database is called Email_Log,
With Tables:
Email_ID
e_To
e_From
e_Subject
e_Date

My Insert Code will look something like.

INSERT INTO Email_Log
(Email_ID, e_To, e_From, e_Subject, e_Date)
VALUES
(Data, data, data, data, data)

I have used OpenPop before to create webservice to retrieve mails, so i know how to do that, my exp with windows services are … none and with databases very little.

I’m looking for some example code on how to do this? or some useful links to sights that have done something similar to this. I have looked online and can’t find any help in what i’m trying to do. I just need a push start. Following an example is the best way to start.

  • 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-06-03T08:26:40+00:00Added an answer on June 3, 2026 at 8:26 am
    • For authoring Windows Services in .NET => here.
    • For accessing a SQL database in .NET => here

    So for example here’s how a sample INSERT query might look like using plain ADO.NET:

    using (var conn = new SqlConnection("your connection string to the database"))
    using (var cmd = conn.CreateCommand())
    {
        conn.Open();
        cmd.CommandText = 
            @"
            INSERT INTO Email_Log
            (Email_ID, e_To, e_From, e_Subject, e_Date)
            VALUES
            (@id, @to, @from, @subject, @date)
            ";
        cmd.Parameters.AddWithValue("@id", 123);
        cmd.Parameters.AddWithValue("@to", "foo@bar.com");
        cmd.Parameters.AddWithValue("@from", "baz@boo.com");
        cmd.Parameters.AddWithValue("@subject", "some subject");
        cmd.Parameters.AddWithValue("@date", DateTime.Now);
        cmd.ExecuteNonQuery();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.