1

これらの手順の後、データベース内のテーブルが影響を受けるかどうかを知るにはどうすればよいですか? コンソールにクエリ結果を表示しようとしましたが、何も表示されません。

static void Main(string[] args)
{
    DateTime date = new DateTime(2013, 3, 4);

    try 
    {
        SqlConnection connection = new SqlConnection("Data Source=ExchangeRatesByDate/TestApplication/Rates_DB.sdf");
        Console.WriteLine("Connection is created");

        connection.Open();
        Console.WriteLine("Connection is opened");

        SqlCommand insertCommand = connection.CreateCommand();
        insertCommand.CommandText = "INSERT INTO Rates_Table(ISO, Amount, Rate, Date) VALUES (USD, 1, 417.5, date)";
        insertCommand.ExecuteNonQuery();

        SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Rates_Table", connection);
        DataTable data = new DataTable();
        adapter.Fill(data);

        Console.WriteLine(adapter);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.ToString());
    }
}
4

3 に答える 3