Articles in this section
Category / Section

How do I read and post the Actobat form data to a database?

1 min read

 

We can read and send the Actobat form data to a database with the help of the PdfSubmitAction class. We can post data back to the database by creating the form''s submit action.

Then clicking on the submit button in the pdf document will submit the form contents to the server. Then we can read this request from the server and store the form-field data on to the database.

C#

//through which the PDF form should post data to the server.

PdfSubmitAction action = new PdfSubmitAction("http://websamples.syncfusion.com/samples/pdf.web/T285/PDFdemo/RequestForms.aspx");

action.DataFormat = SubmitDataFormat.Html;

//Reading Values

string username = Request.Form["username"];

string password = Request.Form["password"];

// Store the values in DataBase

OleDbConnection connection = new OleDbConnection(ConnString);

connection.Open();

// The insertSQL string contains a SQL statement that inserts a new row in the source table.

OleDbCommand command = new OleDbCommand(INSERT);

// Set the Connection to the new OleDbConnection.

command.Connection = connection;

command.ExecuteNonQuery();

VB

'through which the PDF form should post data to the server.

Dim action As PdfSubmitAction = New PdfSubmitAction("http://websamples.syncfusion.com/samples/pdf.web/T285/PDFdemo/RequestForms.aspx")action.DataFormat = SubmitDataFormat.Html

' Reading Values

Dim username As String = Request.Form("username")

Dim password As String = Request.Form("password")

' Store the values in DataBase

Dim connection As OleDbConnection = New OleDbConnection(ConnString)

connection.Open()

' The insertSQL string contains a SQL statement that

' inserts a new row in the source table.

Dim command As OleDbCommand = New OleDbCommand(INSERT)

' Set the Connection to the new OleDbConnection.

command.Connection = connection

command.ExecuteNonQuery()

Please do find the sample from the below specified location which demonstrates the above feature,

http://websamples.syncfusion.com/samples/pdf.web/T285/PDFdemo/main.htm

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied