ASP.NET - Integration of tally with ASP.net with c#

Asked By Rtanesh on 28-Mar-12 01:25 PM
Hello,


  I want to integrate tally software with my fee module developed in .net. Please provide me some ideas or sample to integrate it. Integration might be in term of database or some other way.

Any help will be appreciated.

Thanks,

Ratnesh
Suchit shah replied to Rtanesh on 28-Mar-12 02:31 PM
RTSlink is a Dynamic Link Library (DLL) that allows Software Developers to Integrate their Applications with Tally Accounting Software. Using RTSlink, developers can pull data from Tally Software into their .NET application or push data from their .NET application into Tally Software.\

http://www.rtslink.com/VB.NET-to-tally-Csharp-to-tally-ASP.NET-to-tally.html 
Devil Scorpio replied to Rtanesh on 28-Mar-12 02:41 PM
Hi,

Here is the code to integrate tally with ASP.net using C#

//Note:-Condition Apply : Tally Erp 9.0 must be in running mode.
 
BulkCopyCS objBlk = new BulkCopyCS();
if (!IsPostBack)
      {
        string source = "PORT=9000;DRIVER=Tally ODBC Driver;SERVER={(local)}";
        OdbcConnection con = new OdbcConnection(source);
        con.Open();
        DataTable dt = new DataTable();
        string[] restrictions = new string[1];
        dt = con.GetSchema("Tables");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
          ListBox1.Items.Add(dt.Rows[i][2].ToString());

          //FETCH TALLY TABLES TO SQL : this line is commented due all tables are now in sql
          #region
          //DataSet objds = fetchTallyTableContent(dt.Rows[i][2].ToString());
          //objBlk.CreateTable(objds.Tables[0], Convert.ToString(dt.Rows[i][2]));
          //objBlk.BulkLoad(objds.Tables[0], Convert.ToString(dt.Rows[i][2]));
          #endregion
        }
        Label1.Text = "Total No. of tables in Tally : " + Convert.ToString(dt.Rows.Count);
        con.Close();
      }
    }
    protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
      Label2.Text = "Table Name : " + Convert.ToString(ListBox1.SelectedItem.Text);
      DataSet objds = fetchTallyTableContent(Convert.ToString(ListBox1.SelectedItem.Text));
      GridView2.DataSource = objds;
      GridView2.DataBind();
    }
    public DataSet fetchTallyTableContent(string tblName)
    {
      string query = "SELECT * FROM Techweb.TallyUser." + tblName + " " + tblName;
      string source = "PORT=9000;DRIVER=Tally ODBC Driver;SERVER={(local)}";
      OdbcConnection con = new OdbcConnection(source);
      OdbcCommand cmd = new OdbcCommand(query, con);
      con.Open();
      OdbcDataAdapter da = new OdbcDataAdapter(query, con);
      DataSet ds = new DataSet();
      da.Fill(ds);     
      con.Close();
      return ds;
    }

==============================================================
//CLASS FILE CONTENT


public class BulkCopyCS
{
    public BulkCopyCS()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public void CreateTable(DataTable dt, string tblName)
    {
      SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["TestDatabaseConnectionString"].ConnectionString);
      string tblStr = string.Empty;
      if (dt.Rows.Count > 0)
      {
        for (int i = 0; i < dt.Columns.Count; i++)
          tblStr += Convert.ToString(dt.Columns[i].ColumnName) + " VARCHAR(255),";
        tblStr = tblStr.Remove(tblStr.Length - 1, 1);
        tblStr = tblStr.Replace("$_", "Second");
        tblStr = tblStr.Replace("'", "");
        tblStr = tblStr.Replace("`", "");
        tblStr = tblStr.Replace("$", "");
      }
      string st = "CREATE TABLE " + tblName + " (" + tblStr + " )";

      SqlCommand cmd = new SqlCommand(st, con);
      con.Open();
      try
      {
        cmd.ExecuteNonQuery();
      }
      catch (SqlException ex)
      {
        //MessageBox.Show(ex.Message.ToString());
      }
      con.Close();
    }
    public void BulkLoad(DataTable tbl,string tblName)
    {
      string conn = System.Configuration.ConfigurationManager.ConnectionStrings["TestDatabaseConnectionString"].ConnectionString;
      System.Data.SqlClient.SqlBulkCopy bulkCopy = new System.Data.SqlClient.SqlBulkCopy(conn);
      bulkCopy.DestinationTableName = tblName;
      try
      {
        bulkCopy.WriteToServer(tbl);
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
      }
      finally
      {
        bulkCopy.Close();
      }
    }
}
Anoop S replied to Rtanesh on 29-Mar-12 02:27 AM
Tally Software is developed with a core proprietary engine with a SDK Wrapper. Most of Tally's Interaction Forms and Reports are developed using Tally Definition Language TDL. Customization of Tally Application can be done using this TDL SDK.

Tally.ERP 9 has advanced integration capabilities in the form of Application programming interfaces to make the software extensible. Tally can interactwith Software application using XML, ODBC, DLL technologies.

You can download dll and demo programs from this link
http://www.tallysolutions.com/website/html/developernetwork/integration-capabilities.php
http://www.tallysolutions.com/website/html/tallyerp9/customise-extend-integrate-interfae-integrateability.php
Somesh Yadav replied to Rtanesh on 29-Mar-12 08:17 AM
please see http://www.dreamincode.net/forums/topic/128218-tally-integration/
Rtanesh replied to Devil Scorpio on 29-Mar-12 11:30 AM
Hi Scorpio,

   Thanks for your help. It helped me a lot. I can fetch the record of from tally. But i want to know the database structure of tally. can you please let me know how the tables are related in tally. please give some example for this. What I want is to access the tally through my ASP.Net(C#) application like get the voucher details from tally as it shows in tally.


Thanks,

Ratnesh