First of all im not sure if this is the correct section to ask this.
Im using C# .NET
I m trying to populate a gridview using datareader with the following code
Expand|Select|Wrap|Line Numbers
- protected void page_load (object sender, System.EventArgs e)
- {
- SQLCon.ConnectionString = constr;
- SQLCon.Open();
- System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("select distinct f.name, f.address, f.telephone , n.name, w.wrario, e.date from farmakeia f, efimeries e, wraria w, nomos n where e.farmakeia_idfarmakeia = f.idfarmakeia and e.wraria = w.idwraria and f.nomos_idnomos = n.idnomos and n.idnomos='" + FarmakeiaNomosID + "' and date='2011-01-09'", SQLCon);
- System.Data.SqlClient.SqlDataReader dtr = cmd.ExecuteReader();
- dtr.Read();
- this.GridView2.DataSource = dtr;
- this.GridView2.DataBind();
- dtr.Close();
- }
It retrieves 1 less value than it should.
When im using the same query on sql managment studio it works just fine.
It seems strange to me, i would apriciate any help.
Thank you in advance.