Jump to content

C# SQL Verbindung herstellen

Recommended Posts

Hi Leute,


der folgende Codeblock funktioniert so nicht, weiß einer vielleicht warum?

            SqlConnectionStringBuilder conBuilder = new SqlConnectionStringBuilder();
            conBuilder.DataSource = "localhost";
            conBuilder.InitialCatalog = "gridplan";
            conBuilder.UserID = "root";
            conBuilder.Password = "222103";
            SqlConnection con = new SqlConnection(conBuilder.ConnectionString);


Bekomme eine Exception, da der Server nicht gefunden werden kann.


Server läuft auf jedenfall. Sitze schon eine Stunde daran und bin mittlerweile ratlos.

Link to post
Share on other sites

Mal "(local)" oder "." statt localhost gestestet? Oder gleich die IP rein?


IntegratedSecurity vllt mal auf true setzen, trustedconnection auch. Tippe eher auf eine Einstellung im SQL Server. Was für einen hast du denn am laufen?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.