Hello,
Here is the below code to submit the xml,
string connectionString = "Get the connection string";
SqlConnection sqlConnection = new SqlConnection(connectionString);
SqlParameter sqlParameter = new SqlParameter("xmlDocument", <Inpur XML String>);
try
{
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand("<Stored Procedure Name>", sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
sqlCommand.Parameters.Add(sqlParameter);
int index = sqlCommand.ExecuteNonQuery();
if (index > 0)
{
statusMessage = "Successfully submitted to database.";
}
}
catch (Exception ex)
{
statusMessage = ex.ToString();
}
Note: Stored procedure should be same as your schema structure of form.