Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 15, 2013 06:21 AM by dj_naveen
Member
30 Points
56 Posts
Feb 25, 2013 08:34 AM|LINK
TPS file is a database file used by Clarion TopScan or TopSpeed.
I need to code to read the data from .tps file and to import it to SQL server database.
Kindly help me to sort out this issue.
Star
9246 Points
1576 Posts
Feb 25, 2013 08:45 AM|LINK
There is an ODBC driver that you can use to read the data via ado.net
http://www.softvelocity.com/Drivers/TSODBC.htm
Feb 25, 2013 08:49 AM|LINK
Hi AidyF,
I do know that there is a TPS driver but how to code is my question?
Contributor
5032 Points
956 Posts
Feb 25, 2013 09:21 AM|LINK
Below post may help you,
http://www.tek-tips.com/viewthread.cfm?qid=1480840
Feb 26, 2013 08:14 AM|LINK
Hi Prabu,
Thanks for your post.
But it doesn't solve my issue .
I need a C# code to retrieve data from TopSpeed file (.tps) and then import it to SQL Server.
Mar 08, 2013 08:55 AM|LINK
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.
Mar 15, 2013 06:21 AM|LINK
The select statement should be "SELECT * FROM UNNAMED" instead of "SELECT * FROM EmployeeMaster.tps"
dj_naveen
Member
30 Points
56 Posts
How to read .tps file (flat file)
Feb 25, 2013 08:34 AM|LINK
TPS file is a database file used by Clarion TopScan or TopSpeed.
I need to code to read the data from .tps file and to import it to SQL server database.
Kindly help me to sort out this issue.
AidyF
Star
9246 Points
1576 Posts
Re: How to read .tps file (flat file)
Feb 25, 2013 08:45 AM|LINK
There is an ODBC driver that you can use to read the data via ado.net
http://www.softvelocity.com/Drivers/TSODBC.htm
dj_naveen
Member
30 Points
56 Posts
Re: How to read .tps file (flat file)
Feb 25, 2013 08:49 AM|LINK
Hi AidyF,
I do know that there is a TPS driver but how to code is my question?
prabu.raveen...
Contributor
5032 Points
956 Posts
Re: How to read .tps file (flat file)
Feb 25, 2013 09:21 AM|LINK
Below post may help you,
http://www.tek-tips.com/viewthread.cfm?qid=1480840
dj_naveen
Member
30 Points
56 Posts
Re: How to read .tps file (flat file)
Feb 26, 2013 08:14 AM|LINK
Hi Prabu,
Thanks for your post.
But it doesn't solve my issue
.
I need a C# code to retrieve data from TopSpeed file (.tps) and then import it to SQL Server.
dj_naveen
Member
30 Points
56 Posts
Re: How to read .tps file (flat file)
Mar 08, 2013 08:55 AM|LINK
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.
dj_naveen
Member
30 Points
56 Posts
Re: How to read .tps file (flat file)
Mar 15, 2013 06:21 AM|LINK
The select statement should be "SELECT * FROM UNNAMED" instead of "SELECT * FROM EmployeeMaster.tps"