Slt,
je suis débutant et n?arrive pas á entrer dans ma base de donnée pour lire les informations et les faire ressortir á l écran:
voici mon code, pouvez vs m?aider?
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace New
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class DataReader_SQL
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
try
{
SqlConnection thisConnection = new SqlConnection(@"Network Library=DBMSSOCN;Data Source=192.168.0.100,1433;database=HQSP0195.dbo;User id=sa;Password=;");
thisConnection.Open();
SqlCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "SELECT HZO, HZO_OFEN FROM HZO_HZUG";
SqlDataReader thisReader = thisCommand.ExecuteReader();
while (thisReader.Read())
{
Console.WriteLine("\t{0}\t{1}", thisReader["HZO"], thisReader["HZO_OFEN"]);
}
thisReader.Close();
thisConnection.Close();
}
catch (SqlException e)
{
Console.WriteLine(e.Message);
}
}
}
}
comme résultat j?ai un écran tout noir, je ne sais pas si c ést datatsource qui est erroné
Merci