0

Hi!

I'm new to asp.net.So,I created a simple project to connect it to a database
to see whether its working fine.

My database contains a table with three fields
1.EmpId
2.EmpName
3.EmpPhoto

I created database and entered a row by using SQL SERVER MANAGEMENT STUDIO EXPRESS 2005.

I used the following codes;

Create Table Customer ( EmpId int, EmpName varchar(50) not null, EmpPhoto varbinary(max) not null )

Insert Customer (EmpId, EmpName, EmpPhoto) Select 1001, 'Vadivel', BulkColumn from Openrowset( Bulk 'C:\ggg.png', Single_Blob) as EmployeePicture

But when I wanted to see this in Grid View itshows System.Byte[] in the EmpPhoto Column.

Please Help me with a understandable solution.

3
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by nextsolution143
0

It's because of your data type on the Customer table. .NET converts SQL binary types to Byte arrays.

What did you want the field to show up as?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.