Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Task - Writing Connection Strings | Introduction to Databases with .NET
Introduction to .NET with C#

book
Task - Writing Connection Strings

Your task is to write the connection string to connect to a MySql server. The server details are given below.

Note

The following details do not point to a real server, so it is not necessary to run the code. This task tests your ability to write a connection string. You can confirm your code's correctness by looking at the provided solution.

IP Address: 123.456.0.7
Port: 7779
User: root
Password: root123

Also, fill in the two blanks with the appropriate type/class name.

cs

index

copy
using System;
using MySql.Data.MySqlClient;

class Program
{
static void Main(string[] args)
{
// Write code below this line
string connectionString = ___;
___ connection = new ___(connectionString);
// Write code above this line
}
}
12345678910111213
using System; using MySql.Data.MySqlClient; class Program { static void Main(string[] args) { // Write code below this line string connectionString = ___; ___ connection = new ___(connectionString); // Write code above this line } }

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 5

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

We use cookies to make your experience better!
some-alt