This project is read-only.

By convention, things like program options and credentials are often stored in a configuration file. Since this is a separate file from the executable file for a program, it permits one to change these parameters in the configuration file using any text editor such as notepad without having to make changes to the program itself.In the case of Windows programs built with Visual Studio the configuration file is generally named app.config.

In the case of Twitter to SQL we store two sets of credentials in the app.config file, namely:

  • The database connection string – this has the information, including the user ID and password, to permit the program to connect t SQL Server.
  • Twitter API keys – these four keys contain the user specific keys assigned by Twitter to the user. These are used to validate the application and user with Twitter at run time to permit access.

Here is a sample app.config file with the sensitive data replaced by Xs:

<?xml version="1.0" encoding="utf-8"?>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    <add name="SqlServerTarget" connectionString="xxxxxxxxxxxx" />
    <!-- Fill in your consumer key and secret here to make the OAuth sample work. -->
    <!-- Twitter sign-up: -->
    <!-- FSharp Follower -->
    <add key="APIkey" value="xxxxxxxxxxxx" />
    <add key="APIsecret" value="xxxxxxxxxxxx" />
    <add key="accessToken" value="xxxxxxxxxxxx" />
    <add key="accessTokenSecret" value="xxxxxxxxxxxx" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />

For information on how to construct a connection string for the SQL Server database see the Microsoft documentation for SQL Server. Alternatively this website provides excellent guidance and samples.

As for the four keys required by Twitter the reader is referred to the Twitter API documentation at which provides documentation on the Twitter API, guidance on accessing the API as well as details on how to register for and obtain keys. Since the actual Twitter access is done by the programs contained in the LINQ to Twitter project,, the user is referred to the documentation there for additional guidance.

If you experience problems accessing Twitter with this project the user should attempt to access Twitter using the sample application contained at LINQ to Twitter, If that works them you know that your API keys are good. If on the other hand that does not work for you it is recommended that you debug using that sample application before returning to this project as that sample is simpler and involves fewer components.

Last edited Mar 6, 2014 at 4:59 AM by JonnyBoats, version 1