![]() |
VOOZH | about |
The CData Cmdlets for Tally are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Tally.
The Cmdlets are not only a PowerShell interface to Tally, but also an SQL interface; this tutorial shows how to use both to retrieve Tally data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Tally. To access Tally data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Tally.
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:
Install the module:
Install-Module TallyCmdlets
Connect:
$tally = Connect-Tally -Url "$Url"
Search for and retrieve data:
$companynumber = "1000" $company = Select-Tally -Connection $tally -Table "Company" -Where "CompanyNumber = `'$CompanyNumber`'" $company
You can also use the Invoke-Tally cmdlet to execute SQL commands:
$company = Invoke-Tally -Connection $tally -Query 'SELECT * FROM Company WHERE CompanyNumber = @CompanyNumber' -Params @{'@CompanyNumber'='1000'}
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
}
Download a free trial of the Tally Data Provider to get started:
Download NowLearn more:
👁 Tally IconRapidly create and deploy powerful .NET applications that integrate with Tally.