Has anyone come across this, and hopefully know a solution
'NullReferenceException not handled by user code'
this appears when i try and upload a photo in member_details.aspx.
does anyone have any ideas, the code is similar to image fetch.aspx,
which works fine.
thanks
Malcolm
Public Sub writeSingleImage(ByVal MemberID As Guid, ByVal output As IO.Stream)
'todo fix the following line of code
Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ClubSiteDB").ConnectionString)
Dim qry As String = "select avatar from memberinfo where memberid=@memberid"
Dim command As New SqlCommand(qry, connection)
Dim param0 As New Data.SqlClient.SqlParameter("@memberid", Data.SqlDbType.UniqueIdentifier)
param0.Value = MemberID
command.Parameters.Add(param0)
connection.Open()
Dim d As Byte() = CType(command.ExecuteScalar(), Byte())
output.Write(d, 0, d.Length)
connection.Close()
End Sub