I have a connection to a database view (SQL Server 2008 R2). But I don't know any of the columns. I need to select everything on that view. How can I do this by using SqlDataReader
?
SqlConnection con = new SqlConnection(conString);
con.Open();
SqlCommand command = new SqlCommand("select * from vw_Haber_Baslik_Ozet", con);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
//reader.get?? I will write the things I get to a file
}
reader.Close();
con.Close();
Once I learn the structure of this view I can create a proper class to store the values. But how can I learn the structure?