How create Windows Services in Azure using Visual Studio 2012

Hi,
I have a need to write a Windows Service (Batch Job), which would execute everyday at a specified time, say 4:00AM. This job will do some processing and will send out an email to predefined users. I am using Visual Studio 2012 for the development.
Based on some research, it looks like that Azure doesn't have a concept of Windows Service. Rather, we need to create WorkerRole to achieve the same.
I wrote the code to implement the WorkerRole. The problem, I am facing is that
1. How to prevent the continuous looping of the code below? I want the task to be executed only once a day at 4:00AM
2. How do I schedule this functionality in Azure?
Any help will be highly appreciated. I have provided the code sample below.
Thanks.
   public class WorkerRole : RoleEntryPoint
        public override void Run()
            while (true)
                SendNewsEmail();
                Thread.Sleep(10000);
       private void SendNewsEmail()
            /*Email Logic Goes Here*/
        public override bool OnStart()
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;
            return base.OnStart();

HI
I think JuneT's answer is what you want.
However it's for Azure website.
If you still want to use a workerRole, you need much harder work.
You can use Timers Class to do such things:
http://stick2basic.wordpress.com/2013/02/22/how-to-schedule-a-c-windows-service-to-run-a-method-daily/
How do I schedule this functionality in Azure
I suggest you save the settings file in a cloud table, and notify your webrole using WCF service to let the service get the new settings when your changed it.
My Blog
Please use Make as Answer if my post solved your problem and use
Vote As Helpful if a post was useful.

Similar Messages

  • How to put if condition by using visual studio 2012 for project server 2013 worflow

    Hi,
     If Project Data:Funding Required equals Yes
        Go to s2- Lead Approval
    Else
        Go to End of Workflow
     above condition is used it in sharepoint designer. I want same condition used in visual studio 2012.
    Please help me how to get fields of project server in visual studio 2012.
    Thanks in Advance in helping us.
    Thank you
    Vinay

    Hi Vinay,
    I can't help you for the code, but the IF THEN ELSE statement is pretty well documented in the article below:
    http://msdn.microsoft.com/en-us/library/752y8abs.aspx
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Create SharePoint 2013 hosted app using visual studio 2013

    i tried to create sharepoint hosted app, i just created a new project and try to deploy it but it failed every time with different error sometimes system account can't run the project, created another administrator and try to re deploy it so i had a new
    error that the visual studio project need a administration permissions and i already grant the administration permissions for the new user, any one can provide a complete tutorials on how we can create new hosted sharepoint app using visual studio 2013
    Mohamed Abdeen

    Hi,
    According to your post, my understanding is that you want to create SharePoint 2013 hosted app using visual studio 2013.
    Here are some great blogs for your reference:
    How to: Create a basic SharePoint-hosted app
    My First Sharepoint-Hosted App in 2013 - CodeProject
    Setting up your App domain for SharePoint 2013
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • I have VMware Fusion installed on my computer along with windows 7. I'm able to use Visual Studios 2012

    I have VMware Fusion installed on my computer along with windows 7. I’m able to use Visual Studios 2012 & 2013; however, when I try to install SQL Server is says I don’t have a valid installation folder.  So I guess my question is, can you install SQL Server to a MAC?
    Thanks!

    Make sure you have the right version...
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

  • Create office app for word using visual studio 2013

    i tried to create an app for office using visual studio 2013 i just created one in task pane with all default settings and then deployed succesffully and i can't find the app in task pane in word office any ideas
    Mohamed Abdeen

    Hi Mohamed Abdeen,
    Please try to enable a build-in app for Office, such as "Bing dictionary" and check if the task pane pop-up.
    If the "Bing dictionary" works well, I suppose that this issue might be caused by itself. I recommend you post the question to Word for DEV forum:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=worddev&filter=alltypes%2Calllanguages&sort=lastpostdesc
    If all the apps can't be used, they might be blocked. Please go to File/option/trust center/trusted app catalogs/enable it.
    Reference:
    https://technet.microsoft.com/en-us/library/jj219429.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/office/jj220060.aspx?f=255&MSPPError=-2147217396
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Sharepoint 2013 - Can I use Visual Studio 2012 express edition for web-parts and app parts?

    I am new to sharepoint 2013. I want to develop the app and web parts using visual studio 2012 express edition. Can I use vs 2012 express edtion to create app and web parts for sharepoint 2013?

    Unfortunately no, check this post:
    http://sharepoint.stackexchange.com/questions/52338/sharepoint2013-development-with-vs2012-express
    To build SharePoint 2013 webparts/apps you will need the 'Microsoft Office Developer Tools for Visual Studio 2012', which do not come as part of Visual Studio.  The tools require Visual Studio 2012 Ultimate, Premium, or Professional.
    The tools and prerequisites can be found here:
    http://msdn.microsoft.com/en-us/office/apps/fp123627.aspx
    Brandon Atkinson
    Blog: http://brandonatkinson.blogspot.com

  • Create windows service in azure

    I want to create one window service in azure.
    actually i want do that my task running in cloud all the time in azure.
    i have tried to search it on net but i dont get any good solution.
    Also i want free trial azure account. (i tried to create it but at last it ask me for credit card info).
    So please tell me what is requied to do it.
    sagar patel

    Hello sagar_patel,
    1. Whay kind of a task are you trying to deploy onto azure platform?
    2. When you say that you want to create a Windows service, do you mean that you want to create a Web Server?
    3. Are you trying to deploy any website, web application?
    Please refer to the link below that will give you information on the type of services offered and How to get started:
    http://azure.microsoft.com/en-us/documentation/services/cloud-services/
    About signing up for free trial, you will need to enter your credit card information when you sign up for azure services. To ensure a valid credit card, Microsoft will charge your credit card $1 when signing up for the Free Trial Offer. This is only an authorization
    hold, the charge will be reversed within 3-5 business days.
    http://azure.microsoft.com/en-in/pricing/free-trial-faq/
    Thanks,
    Syed Irfan Hussain

  • Creating app scoped external content type using Provider Hosted App in sharepoint 2013 using visual studio 2012

    Hi,
    I am creating provider hosted app in visual studio 2012 using app scoped external content type having OData with Northwind url
    App manifest start page url  :
    ODataNewAppWeb/Pages/Default.aspx
    In XML it is:
    <StartPage>~remoteAppUrl/Pages/Default.aspx</StartPage>
    When i am deploying app pressing F5 the app gets deployed successfully....
    Now i am changing my start page url in Appmanifest like this:
    ODataNewApp/Lists/Employees
    In XML it looks like:
    StartPage>~appWebUrl/Lists/Employees</StartPage>
    When i am deploying app pressing F5 the app..
    Getting register SOD error.....
    I have followed all the steps like:
    1)Creating app domain
    2)Starting all the required services
    3)Creating root site collection
    But still no success.. Please help me on this.... I am struggling with this from two weeks...

    Have you set up a wildcard DNS entry for the spapps.com domain?
    Also if you're trying to connect from the server you might be hitting loop back check issues.

  • How create custom sharepoint 2013 theme in Visual Studio

    Please advice! I created a custom theme for sharepoint 2013 with fonts, colors and masterpage. Using Design Manager i created a wsp file for this theme. After this i could upload this file to any site and choose my theme. As i understood, Design Manager
    take all files from site (all masterpages, colors and etc), not only my files.
    Now i want to understand how i can create a custom theme in visual studio. I want include in my wsp files only files which i need and may be make a feature, which will be activate my custom theme. 
    Please give any useful recouses which can help to understand how make it right :). Thanks a lot!
    from MSDN forum...

    Hi Evgeny,
    check the following for how to do that
    http://weblogs.asp.net/sreejukg/customize-sharepoint-2013-look-and-feel-for-intranet-sites
    http://weblogs.asp.net/sreejukg/apply-custom-theme-to-sharepoint-2013-mysite-using-feature-stapling
    http://www.sharepointeurope.com/blog/2013/5/3/creating-sharepoint-2013-themes,-first-look,-gotchas,-provisioning-with-visual-studio-2012
    http://yuriburger.net/2013/03/24/deploying-and-activating-sharepoint-2013-themes-using-visual-studio/
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How to add new project developed in visual studio 2012 on tfs 2010

    Hi Friends,
    our development developed new project in visual studio 2012 .
    and we need to add it on tfs 2010 version .
    we added it on existing collection on tfs 2010.
    but itn't works properly .
     i want to know is it possible to add visual studio 2012 developed projects in tfs server 2010
    mastanvali shaik

    Thanks for Adrian's help.
    Hi Balaji,
    Based on your issue, I agree with Adrian's suggestion. Therefore, I suggest you can try Adrian's suggestion to refer the link of Cybermaxs' reply check your issue.
    In addition, I suggest you can use fiddler to check the header definition.
    For more information, I suggest you can refer the Shiv_P's reply in the following link.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/9bb37eec-3467-4fcb-8537-648d04e91e2f/how-to-add-latest-chrome-browser-plugin-in-visual-studio-2010-ultimate-for-performance-testing?forum=vstest
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Windows 8 HTML5/JavaScript Notification Hubs using Visual Studio 2012

    Hi,
    I'm not able to implement Microsoft Azure Notification Hubs using HTML5/JavaScript. Please help
    Thanks

    That is a Windows issue. Perhaps you should contact Microsoft about Windows issue not Visual Studio issue.
    You say it fails to work. So I would imagine it downloaded and installed then you attempt to launch it and it fails to work. Or is it the download that fails to work?
    Windows Compatibility Mode you can search for on the internet also.
    Below is an image of an executables properties. One of the tabs (the one displayed) is for Compatibility. The issue with your system is not an issue for this forum. It's possible a setting displayed below for your executable or possibly your executables
    shortcuts could be altered to correct the issue. Or not.
    La vida loca

  • How to store SQL sproc, scripts from Visual Studio 2012 in source control TFS?

    I have VS 2012, SQL Management 2012.  From VS 2012, how do I store my sproc and table scripts in TFS source control?

    Hi bthumber,
    Regarding TFS issues, I would like to recommend you post the question in the Visual Studio Team Foundation Server forums at
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vstfs
     . It is appropriate and more experts will assist you.
    Thanks,
    Lydia Zhang

  • Create a XML Schema (C#) using Visual Studio Express 2012

    How do I add an XML schema to my xml file?
    Here is my code:
    private void WriteXmlToFile(DataSet dsDataSet)
    if (dsDataSet == null) { return; }
    // Create a file name to write to - creates a string
    string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml";
    // Create the FileStream to write with.
    System.IO.FileStream stream = new System.IO.FileStream
    (xmlfilename, System.IO.FileMode.Create);
    // Create an XmlTextWriter with the fileStream.
    System.Xml.XmlTextWriter xmlWriter =
    new System.Xml.XmlTextWriter(stream,
    System.Text.Encoding.Unicode);
    // Write dsDataSet to the file with the WriteXml method.
    dsDataSet.WriteXml(xmlWriter);
    xmlWriter.Close();
    And here is my xml:
    <NewDataSet>
    <Table1>
    <Item_Code>A0001</Item_Code>
    <Item_Description>Wheels, Horse on</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0002</Item_Code>
    <Item_Description>Wheels, Elephant on</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0003</Item_Code>
    <Item_Description>Wheels, Dog on</Item_Description>
    <Current_Count>0</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>

    Open the XML with NOTEPAD to see if you are getting the correct results. Something may be wrong with you CSV file.  Get original CSV that teacher gave out.  Here is my results and C# code.  The styling is the 2nd line and simply
    requires changing the one line in the C# that outputs the line.
    <?xml version="1.0" encoding="UTF-8"?>
    <?xsl:stylesheet type='text/xsl' href='book.xsl'?>
    <NewDataSet>
    <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Table1">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Item_Code" type="xs:string" minOccurs="0" />
    <xs:element name="Item_Description" type="xs:string" minOccurs="0" />
    <xs:element name="Current_Count" type="xs:int" minOccurs="0" />
    <xs:element name="On_Order" type="xs:string" minOccurs="0" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    <Table1>
    <Item_Code>A0001</Item_Code>
    <Item_Description>Horse on Wheels</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0002</Item_Code>
    <Item_Description>Elephant on Wheels</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0003</Item_Code>
    <Item_Description>Dog on Wheels</Item_Description>
    <Current_Count>0</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0004</Item_Code>
    <Item_Description>Seal on Wheels</Item_Description>
    <Current_Count>3</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0005</Item_Code>
    <Item_Description>Bear on Wheels</Item_Description>
    <Current_Count>7</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0006</Item_Code>
    <Item_Description>Teddy Bear</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0007</Item_Code>
    <Item_Description>Clown</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0008</Item_Code>
    <Item_Description>Puppy(crouch)</Item_Description>
    <Current_Count>3</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0009</Item_Code>
    <Item_Description>Puppy(stand)</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0010</Item_Code>
    <Item_Description>Puppy(jump)</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0011</Item_Code>
    <Item_Description>Pupp(lying)</Item_Description>
    <Current_Count>1</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0012</Item_Code>
    <Item_Description>Cart with Blocks (50)</Item_Description>
    <Current_Count>0</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0013</Item_Code>
    <Item_Description>Cart with Blocks (100)</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0014</Item_Code>
    <Item_Description>Cart with Blocks (200)</Item_Description>
    <Current_Count>4</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0015</Item_Code>
    <Item_Description>Train with 0 Carriage</Item_Description>
    <Current_Count>12</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0016</Item_Code>
    <Item_Description>Train with 1 Carriage</Item_Description>
    <Current_Count>10</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0017</Item_Code>
    <Item_Description>Train with 2 Carriage</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0018</Item_Code>
    <Item_Description>Train with 3 Carriage</Item_Description>
    <Current_Count>4</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0019</Item_Code>
    <Item_Description>Train with 4 Carriage</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0020</Item_Code>
    <Item_Description>Train with 5 Carriage</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0021</Item_Code>
    <Item_Description>Building Blocks (20)</Item_Description>
    <Current_Count>15</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0022</Item_Code>
    <Item_Description>Building Blocks (30)</Item_Description>
    <Current_Count>13</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0023</Item_Code>
    <Item_Description>Building Blocks (40)</Item_Description>
    <Current_Count>16</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0024</Item_Code>
    <Item_Description>Building Blocks (50)</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0025</Item_Code>
    <Item_Description>Building Blocks (100)</Item_Description>
    <Current_Count>2</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0026</Item_Code>
    <Item_Description>Building Blocks (200)</Item_Description>
    <Current_Count>8</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0027</Item_Code>
    <Item_Description>Windmill</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0028</Item_Code>
    <Item_Description>Farmhouse</Item_Description>
    <Current_Count>6</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0029</Item_Code>
    <Item_Description>Fencing</Item_Description>
    <Current_Count>22</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0030</Item_Code>
    <Item_Description>Barn</Item_Description>
    <Current_Count>12</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0031</Item_Code>
    <Item_Description>Tractor</Item_Description>
    <Current_Count>6</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0032</Item_Code>
    <Item_Description>Animals</Item_Description>
    <Current_Count>3</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0033</Item_Code>
    <Item_Description>House</Item_Description>
    <Current_Count>9</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0034</Item_Code>
    <Item_Description>Car</Item_Description>
    <Current_Count>12</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0035</Item_Code>
    <Item_Description>Building (small)</Item_Description>
    <Current_Count>4</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0036</Item_Code>
    <Item_Description>Building (medium)</Item_Description>
    <Current_Count>3</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0037</Item_Code>
    <Item_Description>Building (tall)</Item_Description>
    <Current_Count>4</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0038</Item_Code>
    <Item_Description>Shop</Item_Description>
    <Current_Count>7</Current_Count>
    <On_Order>No</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0039</Item_Code>
    <Item_Description>Traffic Lights</Item_Description>
    <Current_Count>5</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    <Table1>
    <Item_Code>A0040</Item_Code>
    <Item_Description>Petrol Station</Item_Description>
    <Current_Count>4</Current_Count>
    <On_Order>Yes</On_Order>
    </Table1>
    </NewDataSet>
    C#
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.OleDb;
    using System.Xml;
    using System.Xml.Xsl;
    namespace CSVImporter
    public partial class CSVImporter : Form
    //const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml";
    const string xmlfilename = @"C:\temp\test.xml";
    DataSet ds = null;
    public CSVImporter()
    InitializeComponent();
    WriteXML();
    public void WriteXML()
    // Create a Open File Dialog Object.
    openFileDialog1.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*";
    openFileDialog1.ShowDialog();
    string fileName = openFileDialog1.FileName;
    //doc.InsertBefore(xDeclare, root);
    // Create a CSV Reader object.
    CSVReader reader = new CSVReader();
    ds = reader.ReadCSVFile(fileName, true);
    dataGridView1.DataSource = ds.Tables["Table1"];
    StringWriter stringWriter = new StringWriter();
    ds.WriteXml(new XmlTextWriter(stringWriter), XmlWriteMode.WriteSchema);
    string xmlStr = stringWriter.ToString();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xmlStr);
    XmlDeclaration xDeclare = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.InsertBefore(xDeclare, doc.FirstChild);
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    String PItext = "type='text/xsl' href='book.xsl'";
    newPI = doc.CreateProcessingInstruction("xsl:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    doc.Save(xmlfilename);
    XslCompiledTransform myXslTrans = new XslCompiledTransform();
    myXslTrans.Load(xmlfilename);
    string directoryPath = Path.GetDirectoryName(xmlfilename);
    myXslTrans.Transform(xmlfilename, directoryPath + "result.html");
    webBrowser1.Navigate(directoryPath + "result.html");
    public class CSVReader
    public DataSet ReadCSVFile(string fullPath, bool headerRow)
    string path = fullPath.Substring(0, fullPath.LastIndexOf("\\") + 1);
    string filename = fullPath.Substring(fullPath.LastIndexOf("\\") + 1);
    DataSet ds = new DataSet();
    try
    if (File.Exists(fullPath))
    string ConStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" + ";Extended Properties=\"Text;HDR={1};FMT=Delimited\\\"", path, headerRow ? "Yes" : "No");
    string SQL = string.Format("SELECT * FROM {0}", filename);
    OleDbDataAdapter adapter = new OleDbDataAdapter(SQL, ConStr);
    adapter.Fill(ds, "TextFile");
    ds.Tables[0].TableName = "Table1";
    foreach (DataColumn col in ds.Tables["Table1"].Columns)
    col.ColumnName = col.ColumnName.Replace(" ", "_");
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    return ds;
    jdweng

  • I am converting existing wpf application to Windows phone 8 app using visual studio 2013

    i want to replace the  xmltextreader for windows phone 8 project ????
    as we dont have  xmltextreader.whitespacehandling...... how to replace this for windows phone project.....
    and i am getting some more error like 'system.net.sockets.socket' doesnot contain a defination for 'beginconnect' and no extension method 'beginconnect' accepting a first argument........

    Hi sagaradi,
    >> So now i want to target that application  to windows 8.1 store and Windows phone 8.1
    For the exception about "System.net.sockets.socket doesnot contain a defination for 'BeginAccept' and no extension mehod 'BeginAccept' accepting a first argument of type 'system.sockets'cuold not be found",
    it is because that System.Net.Sockets is not available in Windows Phone Runtime app, we have to use the
    Windows.Networking.Sockets for instead, for more information, please try to refer to:
    http://stackoverflow.com/questions/23477961/cannot-find-system-net-sockets-assembly-for-wp-8-1 .
    For others exceptions, since I do not have your code, it will be hard to tell. But although WPF/Windows Phone/Windows Store are all XAML-based platforms, they still have a lot of difference among them. Some API which are available in the WPF
    may be not available in the Windows Store and Windows Phone. So please pay attention on it, for more information, please try to refer to the following article:
    #Move form WPF and Microsoft Silverlight to WinRT:
    https://msdn.microsoft.com/en-us/library/windows/apps/br229571.aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Has any one worked on sharepoint 2013 workflows using visual studio.

    Has any one worked with sharepoint 3013 workflows using visual studio.

    Hi,
    To develop SharePoint 2013 workflow using Visual Studio, you can refer to:
    Develop SharePoint 2013 workflows using Visual Studio
    Create a SharePoint workflow app using Visual Studio 2012
    Get started with workflows in SharePoint 2013
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Scanner/camera wizard popup no longer shows up since iTunes update 9.0.2.25

    I used to get the scanner/ camera wizard popup when first plugging in my ipod. However, after latest iTunes update, I do not get it anymore. Can anyone tell me where I can find it? My ipod shows up fine in the itunes window. It does NOT show up at al

  • How can i run a version of Logic 7 on mac OS X 10.9.2?

    Hi. I am running Logic Pro X on a Macbook Pro 2.7 GHz Intel Core i7 running OS X 10.9.2. However, I have some very old but crucial Logic files from the Logic 4/5 days and need to convert them to my current version of Logic Pro X via Logic 7. Does any

  • Document created in 2011 in Pages.

    I have a document created in 2011 in Pages.  When trying to open it now I get the message "This document can't be opened because it's too old.  To open it, save it with Pages '09 first."      How on earth do I do that? Any help would be appreciated. 

  • Oracle 10g :: APEX not running

    Hi, I have installed Oracle 10g in my pc with the default configuration. First day of installation APEX client was running but now its not running. Server is running correctly as I saw server processes in the Process Manager (Task Manager). I am usin

  • Transferri​ng shows from DVR to DVR

    I just got FiosTv and the box we received doesn't work. However, it worked long enough for me to program it to tape all of my shows for a week, and it appears to have taped all of them. But now we have to get a new box and I will lose all of my shows