Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
c# with mysql
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Data; using System.Data.OleDb; namespace Rextester { public class Program { public static void Main(string[] args) { // The connection string assumes that the Access // Northwind.mdb is located in the c:\Data folder. /* string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\SerwerFTP\base\myBase.accdb; Jet OLEDB:Database Password=MyDbPassword;"; */ string connectionString = @"Provider=MySQLProv;Data Source=mysql8.db4free.net:3307;User Id=emialmasia;Password=nikitita28;"; // Provide the query string with a parameter placeholder. string queryString = "select convert(varchar(10), getdate(), 111)"; // Specify the parameter value. int paramValue = 5; // Create and open the connection in a using block. This // ensures that all resources will be closed and disposed // when the code exits. using (OleDbConnection connection = new OleDbConnection(connectionString)) { // Create the Command and Parameter objects. OleDbCommand command = new OleDbCommand(queryString, connection); //command.Parameters.AddWithValue("@pricePoint", paramValue); // Open the connection in a try/catch block. // Create and execute the DataReader, writing the result // set to the console window. try { connection.Open(); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { Console.WriteLine("\t{0}\t{1}\t{2}", reader[0], reader[1], reader[2]); } reader.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadLine(); } } } }
run
|
edit
|
history
|
help
0
1
Jerold
Simplified login system
extension methods
loop exmple
PassByValue vs PassByRerefence
Is String a Palindrome
Operators
asdasd
stockSeries