[ uvelaruza @ 12.12.2014. 16:58 ] @
Želim da ispišem podatke iz tabele... Pokušala sam ovako ali neće da radi.. Code: SqlConnection con = new SqlConnection(connstring); SqlCommand com; try { com = new SqlCommand(); com.Connection = con; com.CommandText = "select * from table_name"; con.Open(); SqlDataReader reader = com.ExecuteReader(); if (reader.HasRows) { DataTable dt = new DataTable(); dt.Load(reader); dataGridView1.DataSource = dt; } } finally { con.Close(); } Da li ima neko ideju? Hvala unaprijed.. |