Showing posts with label friendsi. Show all posts
Showing posts with label friendsi. Show all posts

Monday, March 26, 2012

Retriving Deleted record from database

Hi friends

I have a bit problem here

Just I want to get back all deleted record of database

How do I perform this task?
If It is possible then plz help me out?

Thanks in Advance

Khan

if you have the backup which was taken before the datas were deleted you can make use of it and restore it any other server and retrieve your records................|||

There is no built-in command to undelete. However, you could use Log Explorer.

http://lumigent.com/products/le_sql.html

retrive a file from a binary data field

hello dear friends

I am trying to save a binary file to database with the following code:

publicstaticvoid memorystreamToDb()

{

MemoryStream mst =newMemoryStream(); UnicodeEncoding u =newUnicodeEncoding(); string Textn ="Test"; byte[] b = u.GetBytes(Textn);

mst.Write(b ,0,Textn.Length );

BinaryReader reader =newBinaryReader(mst); byte[] file = reader.ReadBytes((int)mst.Length); using (SqlConnection connection =newSqlConnection("Some Connection String"))

{

SqlCommand command =newSqlCommand("INSERT INTO temp (examplefile) Values(@.File)", connection);

command.Parameters.Add(

"@.File",SqlDbType.Binary, file.Length).Value = file;

connection.Open();

command.ExecuteNonQuery();

}

reader.Close();

mst.Close();

}

or with the other method from a real file (not memory stream)

publicstaticvoid Addfile(string path)

{

CommonMethods_class k =newCommonMethods_class(); byte[] file = GetFile(path); using (SqlConnection connection =newSqlConnection(k.Get_connection_string()))

{

SqlCommand command =newSqlCommand("INSERT INTO temp (examplefile) Values(@.File)", connection);

command.Parameters.Add(

"@.File",SqlDbType.Binary, file.Length).Value = file;

connection.Open();

command.ExecuteNonQuery();

}

}

and after running each of them seams that the file have been saved; but I can not retrive the files. I have tried some solutions from msdn but inside the created file is empty. the point that i really look for it is to just working with memory not in the disk before saving. and then retriving each field that I want.

looking forward your points

thank you in advance

Hiashk1860 ,

If you haven't readRead and Write BLOB Data by Using ADO.NET Through ASP.NET you can take a look.

|||

hi

thank you for yor response, Yes, I have read the article and some other Articles and still have problem.