Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > Replace Method : Replace(String,DataTable,Boolean) Method
The string to be replaced.
Data table with new data.
Indicates whether field name must be shown.

Replace(String,DataTable,Boolean) Method

Replaces the string with the specified datatable value.
Syntax
'Declaration
 
Overloads Sub Replace( _
   ByVal oldValue As String, _
   ByVal newValues As DataTable, _
   ByVal isFieldNamesShown As Boolean _
) 
'Usage
 
Dim instance As IWorksheet
Dim oldValue As String
Dim newValues As DataTable
Dim isFieldNamesShown As Boolean
 
instance.Replace(oldValue, newValues, isFieldNamesShown)

Parameters

oldValue
The string to be replaced.
newValues
Data table with new data.
isFieldNamesShown
Indicates whether field name must be shown.
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
Example
The following code snippet illustrates how to replace the string value with data table.
//Create the data table
DataTable table = new DataTable();
table.Columns.Add("Dosage", typeof(int));
table.Rows.Add(1);
// Replace the value with data table.
sheet.Replace("AB2", table, true);
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also