String query1 select name from seans film where seans id_film film id

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
String query1 = "select name from seans, film where seans.id_film = film.id and seans.id='" + SelectedID.ToString() + "'";
NpgsqlCommand cmd3 = new NpgsqlCommand(query1, conn);
NpgsqlDataReader reader3 = cmd3.ExecuteReader();
reader3.Read();
object[] values2 = new object[reader3.FieldCount];
reader3.GetValues(values2);
//string s = "film " + (string)values2[0];
label1.Text = "Film";
label2.Text = (string)values2[0];
String query2 = "select date_only from seans where id='"+ SelectedID.ToString() +"'";
NpgsqlCommand cmd2 = new NpgsqlCommand(query2, conn);
NpgsqlCommand cmd4 = new NpgsqlCommand(query2, conn);
NpgsqlDataReader reader4 = cmd4.ExecuteReader();
reader4.Read();
object[] values3 = new object[reader4.FieldCount];
reader4.GetValues(values3);
System.DateTime date =(System.DateTime) values3[0];
label4.Text = "Date";
label5.Text = date.ToString();