- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
command = new System.Data.SqlClient.SqlCommand();
command.Connection = connection;
command.CommandText = "select data from filestorage where id=@id;";
command.Parameters.AddWithValue("@id", fileId);
command.CommandType = CommandType.Text;
byte[] data = (byte[])command.ExecuteScalar();
command.CommandText = "select filename from filestorage where id=@id;";
string fName = (string)command.ExecuteScalar();
command.CommandText = "select sizebytes from filestorage where id=@id;";
long lngFileSize = (int)command.ExecuteScalar();
command.CommandText = "select foldername from filestorage where id=@id;";
string store= command.ExecuteScalar().ToString();
> такого на php ещё никто не делал
А кто пользуется наработками уровня абстракции БД, тому писать подобное не придет в голову
Хотя возможно он просто не знает других методов, кроме ExecuteScalar.