im the beginner of .net, im doing the project to save and retrive the files i开发者_JAVA技巧n asp.net with c# , i done saved the files to sql in binary format, and i dont know how to retrive the file in grid view, also i dont know how to play the video file in gridview, can any one help to make that please..
It is not a good practice to save large sized files (like video,documents etc) in database (as binary or varbinary). Instead you upload them to a structured folder outside root and save only the file name(name/path) in the database.
If you really want to do as you asked do the following steps:
1. Convert the binary file to a byte array as follows,
byte[] byteArray=GetBinaryFromDB().TOArray();
2. Then pass the byte array to the following function within System.IO namespace,
File.WriteAllBytes (strng path, byte[] bytes) //This will save your file in the path you specified as first argument.
In order to play the video file you should design a suitable API (including a flash movie,light box/light window etc)..
精彩评论