Webservice returning byte array

I have a webservice that gets a list of byte[] from the db. I want to be able to return all the values. How do I return a byte[].

 [WebMethod]
        public List<fgrTemplate> StudentVerifications()
         {
            List<fgrTemplate> listOfFgrTemp = new List<fgrTemplate>();
            cn.Open();
            SqlCommand com = new SqlCommand("SELECT Template FROM tblFingerprint", cn);
            SqlDataReader sr = com.ExecuteReader();
            while (sr.Read())
            {
                fgrTemplate fingerprint = new fgrTemplate()
                {
                    ID = sr.GetInt32(0),
                    StudentID = sr.GetInt32(1),
                    Description = sr.GetString(2)
                    Template = sr.GetByte??
                };
 listOfFgrTemp.Add(fingerprint);
  }

            cn.Close();
            return listOfFgrTemp;

        }

Answers


Like this:

Template = (byte[])sr[3];

OR

Template = (byte[])sr["Template"];

Need Your Help

android savedInstanceState always null

android

I have the following situation:

styling the a specific row of flex dataGrid

apache-flex datagrid row styling itemrenderer

I have a dataGrid component in flex. My grid has few rows. I simply want to make the last row bold. I just can't figure how to do it.