monsieurmark777
New member
- Joined
- Jun 13, 2009
- Messages
- 2
- Programming Experience
- 1-3
Hi all,
Stumped on something, hopr you can help... I have created a function to create a string to populate a y axis with data:
Function talktosql() As Double
Dim ConnString As String = "Data Source=MARK-WORK\MSSMLBIZ;Initial Catalog=Yahoo_data;Integrated Security=True"
Dim SQLString As String = "SELECT [RDSA.L] FROM yahoo_data.dbo.XLON"
Dim SqlDataAdapter1 As New SqlDataAdapter(SQLString, ConnString)
Dim DataSet1 As New DataSet()
SqlDataAdapter1.Fill(DataSet1, "dataextotbl")
talktosql = Convert.ToDouble(DataSet1.Tables("dataextotbl").Columns("[RDSA.L]"))
MsgBox(talktosql)
End Function
the variable from the function, "talktosql", needs to be called from a sub into the last line from the sub extract below:
Sub creategraph()
Dim DataSeries As New Series
Dim DataSeries2 As New Series
Dim DataSeries3 As New Series
Dim DataSeries As New Series
Dim yValues As Double() = {talktosql()}
so it should for example come out like this:
Dim yValues As Double() = {55.62, 45.54, 73.45, 9.73, 88.42, 45.9, 63.6, 85.1, 67.2, 23.6}
I cannot seem to get the data from the function into the right format to populate "yvalues".
Any clue why? (the msgbox that I put in at the end in the first code renders the result "0")
Many thanks!
Mark
Stumped on something, hopr you can help... I have created a function to create a string to populate a y axis with data:
Function talktosql() As Double
Dim ConnString As String = "Data Source=MARK-WORK\MSSMLBIZ;Initial Catalog=Yahoo_data;Integrated Security=True"
Dim SQLString As String = "SELECT [RDSA.L] FROM yahoo_data.dbo.XLON"
Dim SqlDataAdapter1 As New SqlDataAdapter(SQLString, ConnString)
Dim DataSet1 As New DataSet()
SqlDataAdapter1.Fill(DataSet1, "dataextotbl")
talktosql = Convert.ToDouble(DataSet1.Tables("dataextotbl").Columns("[RDSA.L]"))
MsgBox(talktosql)
End Function
the variable from the function, "talktosql", needs to be called from a sub into the last line from the sub extract below:
Sub creategraph()
Dim DataSeries As New Series
Dim DataSeries2 As New Series
Dim DataSeries3 As New Series
Dim DataSeries As New Series
Dim yValues As Double() = {talktosql()}
so it should for example come out like this:
Dim yValues As Double() = {55.62, 45.54, 73.45, 9.73, 88.42, 45.9, 63.6, 85.1, 67.2, 23.6}
I cannot seem to get the data from the function into the right format to populate "yvalues".
Any clue why? (the msgbox that I put in at the end in the first code renders the result "0")
Many thanks!
Mark