This this code:
SELECT SUBSTRING(posted,1,4) as year FROM styles
reader = cmd1.ExecuteReader(CommandBehavior.CloseConnection);
reader.Read();
Response.Write(reader[0].ToString());
I only get the string "System.Byte[]" printed out. How come?
If I use the software Mysql Query Browser I get the actual string from my database.
I understand that "Byte[]" is an arraylist but how do I convert this to a pure string?
The "posted"-field in my database contains a date like "2010-04-04 13:23:00" and I want to get only the year by using SUBSTRING.