Dobré, už to mám..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace anticek_db
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static void databaze(string[] args)
{
//generate the connection string
string connStr = CreateConnStr("192.168.40.2", "cs", "root", "*****");
//create a MySQL connection with a query string
MySqlConnection connection = new MySqlConnection(connStr);
//open the connection
connection.Open();
//close the connection
connection.Close();
}
public static string CreateConnStr(string server, string databaseName, string user, string pass)
{
//build the connection string
string connStr = "server=" + server + ";database=" + databaseName + ";uid=" + user + ";password=" + pass + ";";
return connStr;
}
private void Form1_Load(object sender, EventArgs e)
{
/// textBox1.Text = pokus();
}
}
}
Ovšem, teď nevím jak udělat to aby to načítalo to a to z databaze... neznam moc tyhle prikazy... Zatim jsem delal jen takove prkotinky