-1
我有一个web服务从数据库获取byte []的列表。我希望能够返回所有的值。如何返回一个字节[]。Webservice返回字节数组
[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;
}
什么是你的字节数组SQL Server中的数据类型? –
模板的数据类型是图像 – user3284789
你不认为'sr.getBytes()'? – Wibble