Automate Tally Integration Tasks from PowerShell
The CData ADO.NET Provider for Tally is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Tally.
ADO.NET Provider
The ADO.NET Provider provides a SQL interface for Tally; this tutorial shows how to use the Provider to retrieve Tally data.
Once you have acquired the necessary connection properties, accessing Tally data in PowerShell can be enabled in three steps.
Set the following connection properties to connect to Tally Instance:
- Url: Set this to the URL for your Tally instance. For example: http://localhost:9000.
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Tally\lib\System.Data.CData.Tally.dll") -
Connect to Tally:
$conn= New-Object System.Data.CData.Tally.TallyConnection("Url='http://localhost:9000/'") $conn.Open() -
Instantiate the TallyDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Name, Address from Company" $da= New-Object System.Data.CData.Tally.TallyDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.name $_.address }