peterpiper
Member
- Joined
- Nov 6, 2013
- Messages
- 5
- Programming Experience
- Beginner
I am attempting to retrieve data from an sql database. I have the following piece of code.
Can somebody kindly point out to me what or where I have gone wrong. When stepping
through the code with F10 it breaks when it gets to while
Thank you
Can somebody kindly point out to me what or where I have gone wrong. When stepping
through the code with F10 it breaks when it gets to while
C#:
SqlConnection cn = new SqlConnection(@"Server=WD\S789;Database=WinDI;User Id=;Password=;");
SqlCommand cmd = new SqlCommand("SELECT zone,country,book,audio FROM Vand ", cn);
cn.Open();
SqlDataReader reader = cmd.ExecuteReader();
{
while (reader.Read())
{
catalog(reader["zone"].ToString(), reader["country"].ToString(), reader["book"].ToString(),
reader["audio"].ToString());
}
}
cn.Close();
Thank you