Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to read .tps file using C#?

1,796 views
Skip to first unread message

David

unread,
Feb 26, 2013, 3:32:53 AM2/26/13
to
Hi,

I need to read .tps file usigng C# and want to import it to sql server database. I do know that we should have tps driver in order to use it in C#.Net. Kindly help me to sort out this issue.......

Regards,
David

kzendra

unread,
Feb 26, 2013, 4:11:22 AM2/26/13
to
www.softvelocity.com
You need ODBC driver which can be bought ot SV site. The rest should be no
problem.

--
It ain't the fall that kills you
It's the sudden stop at the bottom.

http://www.opelclub.hr/

johane...@gmail.com

unread,
Feb 26, 2013, 4:48:40 AM2/26/13
to kze...@email.t-com.hr
Hi kzendra,

Thanks for your response :)

Yep I do aware that we need TPS ODBC driver which can be bought from SV.

How to proceed further after getting the drive is my question?

Kindly let me know if you have any idea.

Leonid Chudakov

unread,
Feb 26, 2013, 9:23:10 PM2/26/13
to kze...@email.t-com.hr
Hi,

You can use topscan utility to export tps data

Leonid Chudakov
chud...@klarisoft.com

johane...@gmail.com

unread,
Feb 26, 2013, 9:46:56 PM2/26/13
to kze...@email.t-com.hr
Hi Leonid,

Thanks for your response. But I need to import the .tps file to SQL Server programmatically only using C#.

Sean H

unread,
Feb 26, 2013, 11:00:13 PM2/26/13
to
The same way you access any ODBC datasourcee in whatever language you're
using.
I don't use .net so I can't really point in any direction.

Sean H

kzendra

unread,
Feb 27, 2013, 3:05:37 AM2/27/13
to
On Tue, 26 Feb 2013 18:46:56 -0800 (PST), johane...@gmail.com wrote:

> Hi Leonid,
>
> Thanks for your response. But I need to import the .tps file to SQL Server programmatically only using C#.
>

How about stop emailing me with every reply to the group?

If you know how to use C#, you have all information you need. Otherwise,
you need C# help.

johane...@gmail.com

unread,
Mar 8, 2013, 4:58:03 AM3/8/13
to
Hi,

I have got the TPS drive and able to open the connection string.

But when I try to fill the dataadapter I am getting a below error.

ERROR [42000] [SoftVelocity Inc.][TopSpeed ODBC Driver]Unexpected extra token: .

at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at ConsoleApplication1.Program.Main(String[] args) in c:\Users\70148320\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 48

My code is below
string connectionString = null;
OdbcConnection cnn;
connectionString = @"Driver={SoftVelocity Topspeed driver (*.tps)};Dbq=C:\Users\Desktop\EmployeeMaster.tps";
cnn = new OdbcConnection(connectionString);
string query = "Select * From EmployeeMaster.tps";

try
{
cnn.Open();
OdbcCommand cmd = new OdbcCommand();
cmd.CommandText = query;
cmd.CommandType = CommandType.Text;
cmd.Connection = cnn;
OdbcDataAdapter da = new OdbcDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cnn.Close();
}
catch (Exception ex)
{
}


Kindly help me to figure out the issue.

manip...@gmail.com

unread,
Jul 10, 2014, 5:22:42 PM7/10/14
to
Try this:

string query = "Select * From EmployeeMaster"

.. without ".tps".

alihassa...@gmail.com

unread,
Nov 23, 2016, 6:44:50 AM11/23/16
to

Roelf Du Preez

unread,
Jan 9, 2017, 10:05:30 AM1/9/17
to
If you have not found the answer to this let me know, I can help.

dema...@gmail.com

unread,
Mar 12, 2017, 2:56:30 PM3/12/17
to
If for some reason you don't want to use the official ODBC driver or don't want to pay for it, there is a free alternative. I'm currently using a TPS reader implementation based on reverse-engineered TPS files. Since it's in Java, I use IKVM to access the the library from .NET.

https://github.com/ctrl-alt-dev/tps-parse
http://www.ikvm.net/

I am using these two in production with fantastic success. But of course, since this is reverse-engineered, you need to be _very_ diligent with testing.
0 new messages