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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:52:51+00:00 2026-05-31T05:52:51+00:00

I use WebMatrix to write my site (C#/MVC3) and I am using a local

  • 0

I use WebMatrix to write my site (C#/MVC3) and I am using a local mysql server (not installed through webmatrix) to store all my data, so i tried to go to the Connections tab and add my server in there as a New Connection. But it just gives me an error no matter what i put for the Host. I know the db name, username & password are correct.

web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <connectionStrings>
        <add connectionString="Uid=username;Server=localhost;Database=mydb;Pwd=pass" name="localhost" providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>

Code:

@{
    Page.Title = "Comics";

    var db = Database.Open("localhost");
    var comics = db.Query(@"SELECT * FROM comics ORDER BY arc ASC").ToList();
}

<h1>@Page.Title</h1>

<ul class="thumbnails gallery">
    @foreach (var comic in comics) {
        <li>@comic.Arc</li>
    } 
</ul>

Error

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Any help is greatly appreciated!

EDIT:

I installed the MySQL connector and i am still getting an error:

Unable to find the requested .Net Framework Data Provider.  It may not be installed. 

I downloaded it from: http://dev.mysql.com/downloads/mirror.php?id=403991 and just installed it with the default settings. Am i supposed to install it into the webmatrix directory?!?

New web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <connectionStrings>
        <add connectionString="Server=localhost;Database=mydb;Uid=user;Pwd=pass;" name="localhost" providerName="MySql.Data.MySqlClient.MySqlConnection" />
    </connectionStrings>
</configuration>
  • 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-31T05:52:52+00:00Added an answer on May 31, 2026 at 5:52 am

    You need to make up your mind whether you are using MySQL (as in the title of your post and the tag you chose) or Sql Server (as in the connection string). If you are using MySQL, you need a different connection string.

    http://www.connectionstrings.com/mysql

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple web service I wrote using Webmatrix that returns data in
I installed Microsoft WebMatrix, which, I believe comes with SQL Server CE4. I've tried
I am using WebMatrix (I'm like, addicted to it), for a new site (well,
Not specifically an Orchard CMS question, but I use Orchard.Web (pre-compilation) in WebMatrix and
use Service layer to persist data into database. But the Unit Test does not
We use a data acquisition card to take readings from a device that increases
I'm not a programmer, but I did manage to develop our company site in
Use case: Fitnesse is used for automated testing of the web site. SUT (software
I'm using Microsoft WebMatrix to develop a small website in ASP.NET Web Pages. I
Mostly I use Visual studio to write mock-up and the back-end code. I want

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.