Database provider: the input string does not have the correct format
Author: victordaniel0405
Creation Date: 5/27/2019 4:41 PM
profile picture

victordaniel0405

#1
Good Morning,

At this moment I am trying to connect Wealth Lab to my database on a SQL server:

First, I select the provider as System.Data.SqlClient and the connection string I am using has this format:

Server = myServerName, port; Database = myDataBase; User ID = myUser; Password = myPassword;

In the database the table has this configuration:

ID IDENTITY Int. (1,1) PRIMARY KEY,
SecurityName varchar (255),
DateTime1 datetime,
[Open] numeric (22.8),
High numeric (22.8),
Low numeric (22.8),
[Close] numeric (22.8),
Volumen numeric (22.8),
NamedSeries varchar (255)

And wealth-lab is able to recognize the different symbols, but when I try to draw the bars, the following error appears:

"Error: La cadena de entrada no tiene el formato correcto.", which means "Error: the input string does not have the correct format"

And only the first bar is drawn.

Where do I have the error?

Thank you for your support
profile picture

Eugene

#2
Hi Victor,

At first glance the database schema looks fine to me (the field types are correct, enough precision etc.) The error can occur during reading of either the OHLC(V) or DateTime1 fields.

If the "first" bar is really the first, double check the following one (and probably the rest) by inspecting the table in SQL Server Management Studio or a similar database editor tool. Some value may be not uniform i.e. it does not conform to the schema.
profile picture

victordaniel0405

#3
Hi Eugene,

I resolved my issue, NamedSeries must be a number not a string,


Thank you for your support
profile picture

Eugene

#4
My bad. I overlooked this in your first post, sorry:

CODE:
Please log in to see this code.

Like you correctly point out, it should be like this instead:
CODE:
Please log in to see this code.


Glad you have resolved the issue yourself and thanks for posting!
profile picture

victordaniel0405

#5
Hi Eugene,

I still don't understand what is the funtion of NamedSeries, what it is this for?

Thank you

profile picture

Eugene

#6
Buen dia Victor,

You'll find it explained in the QuickRef tool (F12 key in Wealth-Lab) > Bars object > NamedSeries Property. Specifically, the DB provider lets you import a (single) auxiliary time series if it's present in your data. For example it can be open interest for Futures. If there is none in your data you may simply not choose anything from the NamedSeries field and it'll be ignored.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).