In C# we do
byte[] imageData = new byte[];
SqlCom.Parameters.Add(new SqlParameter("@ImageData", (object)imageData));
which makes the imageData variable as an object.
But How do i do this in Visual Basic??
Dim imageData As byte() = new Byte()
SqlCom.Parameters.Add(new SqlParameter("@ImageData", ?? ) <-----What Should i do here?
Thanks
Just a bit of update of this question
My code is like this
conn.Open()
Dim cmd As SqlCommand = New SqlCommand("SELECT PhotoID From Photo " & str8 & " And Photo = @Photo", conn)
cmd.Parameters.AddWithValue("@Photo", CType(Photo, Object))
Dim adapter As SqlDataAdapter = New SqlDataAdapter()
adapter.SelectCommand = cmd
adapter.Fill(table) <------when approach this line
PhotoID = table.Rows(0)("PhotoID")
It comes out error like this:
The data types image and varbinary are incompatible in the equal to operator. What should I do?? Thanks
you want some thing like this.