c# - Microsoft word document to OLE field -


I am trying to upload the docx document to access the database.

  OleDbConnection conn = null; OleDbDataReader Reader = Faucet; Try {Conn = new OleDbConnection ("Provider = Microsoft.ACE.OLEDB.12.0;" + "Data Source =" + "" @: "C: \ Audios \ Auditor_Artificci 20077.ACADB"); Conn.Open (); Olebey Commands CMD = New Oleadby Commands (); Cmd.CommandText = "Questions (Category, Question, Answer, Correct Answer, Comment, Reference, Question No, Change, Issue) Prices (@ P2, @ P3, @ P4, @ P5, @ P6, @ P7, P in P8, @ P9, @ P10) "; Byte [] file = file. Read AllBytes (@ "C: \ AudSystem \ rez.docx"); Cmd.Parameters.AddWithValue ("@ P2", 2); Cmd.Parameters.AddWithValue ("@ P3", file); Cmd.Parameters.AddWithValue ("@ P4", file); Cmd.Parameters.AddWithValue ("@ P5", "AD"); Cmd.Parameters.AddWithValue ("@ P6", "FH"); Cmd.Parameters.AddWithValue ("@ p7", "zxc"); Cmd.Parameters.AddWithValue ("@ p8", 1); Cmd.Parameters.AddWithValue ("@ p9", true); Cmd.Parameters.AddWithValue ("@ p10", true); Cmd.Connection = conn; Cmd.ExecuteNonQuery (); } Finally {if (reader! = Null) reader Stop it (); If (conn! = Null) conn.Close (); }  

All are ok, but when I open the database table in the design view, I suppose that in the row "Long Binary Data" is collected instead of "Microsoft Word document" has gone. If I save the file through the Access form in the database, then the file is stored in the form of a "Microsoft Word Document" and I can edit it using the Access form. So, how can I keep programmatic dock files to reach the OLE field as "Microsoft Word Document"?

In the picture, I have saved the same file in the "Question" field in the entry form, but in the "Answer" field by the C # code.

Enter image details here

thanks.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -