Problème C# erreur
C#
-
C# -
C# -
Bonjour, alors je un petit problème par rapport mon code, quand j'exécute mon code je reçoit un erreur de type comme ça "System.Data.OleDb.OleDbException" et un message "nom de fichier non valide" .
Voici mon code.
______________________________________________________________________
C#
______________________________________________________________________
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\test.accdb");
OleDbCommand cmd = conn.CreateCommand();
conn.Open();
cmd.CommandText = @"SELECT
Age
FROM
t2
WHERE ID =1";
using (OleDbDataReader reader = cmd.ExecuteReader())
{
Console.WriteLine(string.Format("{0}",
reader.GetInt32(0).ToString()));
}
conn.Close();
}
}
}
_______________________________________________________________________
Merci d'avance.
Voici mon code.
______________________________________________________________________
C#
______________________________________________________________________
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\test.accdb");
OleDbCommand cmd = conn.CreateCommand();
conn.Open();
cmd.CommandText = @"SELECT
Age
FROM
t2
WHERE ID =1";
using (OleDbDataReader reader = cmd.ExecuteReader())
{
Console.WriteLine(string.Format("{0}",
reader.GetInt32(0).ToString()));
}
conn.Close();
}
}
}
_______________________________________________________________________
Merci d'avance.
A voir également:
- Problème C# erreur
- Erreur 0x80070643 - Accueil - Windows
- Erreur 0x80070643 Windows 10 : comment résoudre le problème de la mise à jour KB5001716 - Accueil - Windows
- Erreur 4101 france tv - Forum Lecteurs et supports vidéo
- Erreur 4201 france tv ✓ - Forum Réseaux sociaux
- Code erreur f3500-31 ✓ - Forum Bbox Bouygues