Jump to content
Software FX Community

Problem using SQLDataReader and stored procedure


User (Legacy)

Recommended Posts

I'm having problems with populating my chart. I'am using MS visual

studio.net for my webpage design. When I run my application I can see a

chart and there are no error massages. Only the chart data seems to be

random and not a representation of my data. If I bind the datareader to a

datagrid I do see the correct data. I think there is a bug or a problem with

chartfx that it wil not bind the DataSource to a SqlDataReader?!?

Can you help me out here?

here is the vb-code for the page load routine

'Put user code to initialize the page here

Dim conPrins As New

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

_db2")

Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend", conPrins)

Dim dtr As SqlClient.SqlDataReader

cmdSelect.CommandType = CommandType.StoredProcedure

cmdSelect.Parameters.Add("@objecttag", "TI600E27")

cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

conPrins.Open()

dtr = cmdSelect.ExecuteReader

Chart1.DataSource = dtr

'DataGrid1.DataSource = dtr

'DataGrid1.DataBind()

dtr.Close()

conPrins.Close()

Regards

Bas Volkers

Link to comment
Share on other sites

I'm having problems with populating my chart. I'am using MS visual

studio.net for my webpage design. When I run my application I can see a

chart and there are no error massages. Only the chart data seems to be

random and not a representation of my data. If I bind the datareader to a

datagrid I do see the correct data. I think there is a bug or a problem with

chartfx that it wil not bind the DataSource to a SqlDataReader?!?

Can you help me out here?

here is the vb-code for the page load routine

'Put user code to initialize the page here

Dim conPrins As New

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

_db2")

Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend", conPrins)

Dim dtr As SqlClient.SqlDataReader

cmdSelect.CommandType = CommandType.StoredProcedure

cmdSelect.Parameters.Add("@objecttag", "TI600E27")

cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

conPrins.Open()

dtr = cmdSelect.ExecuteReader

Chart1.DataSource = dtr

'DataGrid1.DataSource = dtr

'DataGrid1.DataBind()

dtr.Close()

conPrins.Close()

Regards

Bas Volkers

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

ChartFX Lite is a WindowsForms only control and can not be used in a

webpage.

JT

Tech. Support

"Bas Volkers" <basvolkers@admworld.com> wrote in message

news:1BZlQt0gDHA.1496@WEBSERVER1...

> I'm having problems with populating my chart. I'am using MS visual

> studio.net for my webpage design. When I run my application I can see a

> chart and there are no error massages. Only the chart data seems to be

> random and not a representation of my data. If I bind the datareader to a

> datagrid I do see the correct data. I think there is a bug or a problem

with

> chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> Can you help me out here?

>

> here is the vb-code for the page load routine

>

> 'Put user code to initialize the page here

> Dim conPrins As New

>

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> _db2")

> Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend", conPrins)

> Dim dtr As SqlClient.SqlDataReader

> cmdSelect.CommandType = CommandType.StoredProcedure

> cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> conPrins.Open()

> dtr = cmdSelect.ExecuteReader

> Chart1.DataSource = dtr

> 'DataGrid1.DataSource = dtr

> 'DataGrid1.DataBind()

> dtr.Close()

> conPrins.Close()

>

> Regards

> Bas Volkers

>

>

Link to comment
Share on other sites

Hello,

ChartFX Lite is a WindowsForms only control and can not be used in a

webpage.

JT

Tech. Support

"Bas Volkers" <basvolkers@admworld.com> wrote in message

news:1BZlQt0gDHA.1496@WEBSERVER1...

> I'm having problems with populating my chart. I'am using MS visual

> studio.net for my webpage design. When I run my application I can see a

> chart and there are no error massages. Only the chart data seems to be

> random and not a representation of my data. If I bind the datareader to a

> datagrid I do see the correct data. I think there is a bug or a problem

with

> chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> Can you help me out here?

>

> here is the vb-code for the page load routine

>

> 'Put user code to initialize the page here

> Dim conPrins As New

>

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> _db2")

> Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend", conPrins)

> Dim dtr As SqlClient.SqlDataReader

> cmdSelect.CommandType = CommandType.StoredProcedure

> cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> conPrins.Open()

> dtr = cmdSelect.ExecuteReader

> Chart1.DataSource = dtr

> 'DataGrid1.DataSource = dtr

> 'DataGrid1.DataBind()

> dtr.Close()

> conPrins.Close()

>

> Regards

> Bas Volkers

>

>

Link to comment
Share on other sites

  • 2 weeks later...

which newsgroup do we use for chartfx lite for ASP.net?

"SFX Tech Support" <support@softwarefx.com> wrote in message

news:w8%23OjrciDHA.3600@WEBSERVER1...

> Hello,

>

> ChartFX Lite is a WindowsForms only control and can not be used in a

> webpage.

>

> JT

> Tech. Support

>

> "Bas Volkers" <basvolkers@admworld.com> wrote in message

> news:1BZlQt0gDHA.1496@WEBSERVER1...

> > I'm having problems with populating my chart. I'am using MS visual

> > studio.net for my webpage design. When I run my application I can see a

> > chart and there are no error massages. Only the chart data seems to be

> > random and not a representation of my data. If I bind the datareader to

a

> > datagrid I do see the correct data. I think there is a bug or a problem

> with

> > chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> > Can you help me out here?

> >

> > here is the vb-code for the page load routine

> >

> > 'Put user code to initialize the page here

> > Dim conPrins As New

> >

>

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> > _db2")

> > Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend",

conPrins)

> > Dim dtr As SqlClient.SqlDataReader

> > cmdSelect.CommandType = CommandType.StoredProcedure

> > cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> > cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> > cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> > conPrins.Open()

> > dtr = cmdSelect.ExecuteReader

> > Chart1.DataSource = dtr

> > 'DataGrid1.DataSource = dtr

> > 'DataGrid1.DataBind()

> > dtr.Close()

> > conPrins.Close()

> >

> > Regards

> > Bas Volkers

> >

> >

>

>

Link to comment
Share on other sites

which newsgroup do we use for chartfx lite for ASP.net?

"SFX Tech Support" <support@softwarefx.com> wrote in message

news:w8%23OjrciDHA.3600@WEBSERVER1...

> Hello,

>

> ChartFX Lite is a WindowsForms only control and can not be used in a

> webpage.

>

> JT

> Tech. Support

>

> "Bas Volkers" <basvolkers@admworld.com> wrote in message

> news:1BZlQt0gDHA.1496@WEBSERVER1...

> > I'm having problems with populating my chart. I'am using MS visual

> > studio.net for my webpage design. When I run my application I can see a

> > chart and there are no error massages. Only the chart data seems to be

> > random and not a representation of my data. If I bind the datareader to

a

> > datagrid I do see the correct data. I think there is a bug or a problem

> with

> > chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> > Can you help me out here?

> >

> > here is the vb-code for the page load routine

> >

> > 'Put user code to initialize the page here

> > Dim conPrins As New

> >

>

SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> > _db2")

> > Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend",

conPrins)

> > Dim dtr As SqlClient.SqlDataReader

> > cmdSelect.CommandType = CommandType.StoredProcedure

> > cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> > cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> > cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> > conPrins.Open()

> > dtr = cmdSelect.ExecuteReader

> > Chart1.DataSource = dtr

> > 'DataGrid1.DataSource = dtr

> > 'DataGrid1.DataBind()

> > dtr.Close()

> > conPrins.Close()

> >

> > Regards

> > Bas Volkers

> >

> >

>

>

Link to comment
Share on other sites

Hello,

You are right, this is the correct news group.

Likely the reason why this is failing is due to ChartFX not recognizing any valid numeric value within the DataReader to chart. You should specify how each column in the table should be used by ChartFX by using the DataType method. Below I have copied some code from our passing data sample that comes with ChartFX Lite for ASP.Net.

Dim myConnectionString As String

Dim ds As New System.Data.DataSet()

myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("") + "..\Data\ChartfxSamples.mdb"

Dim mySelectQuery As String = "SELECT Projected, Sales,peak from DemoSales"

Dim myConnection As New System.Data.OleDb.OleDbConnection(myConnectionString)

ds = New System.Data.DataSet("Sales")

Dim adapter As New System.Data.OleDb.OleDbDataAdapter()

adapter.SelectCommand = New System.Data.OleDb.OleDbCommand(mySelectQuery, myConnection)

Chart1.DataType(0) = DataType.Value

Chart1.DataType(1) = DataType.Value

Chart1.DataType(2) = DataType.Value

adapter.Fill(ds)

With Chart1

.DataSource = ds.Tables(0)

.Gallery = Gallery.Area 'It requires: Imports SoftwareFX.ChartFX.Lite.Gallery

End With

Chart1.DataBind()

"Scott Leslie" <scott.leslie@sepa.org.uk> wrote in message news:3u9hiSCkDHA.3600@WEBSERVER1...

> which newsgroup do we use for chartfx lite for ASP.net?

>

> "SFX Tech Support" <support@softwarefx.com> wrote in message

> news:w8%23OjrciDHA.3600@WEBSERVER1...

> > Hello,

> >

> > ChartFX Lite is a WindowsForms only control and can not be used in a

> > webpage.

> >

> > JT

> > Tech. Support

> >

> > "Bas Volkers" <basvolkers@admworld.com> wrote in message

> > news:1BZlQt0gDHA.1496@WEBSERVER1...

> > > I'm having problems with populating my chart. I'am using MS visual

> > > studio.net for my webpage design. When I run my application I can see a

> > > chart and there are no error massages. Only the chart data seems to be

> > > random and not a representation of my data. If I bind the datareader to

> a

> > > datagrid I do see the correct data. I think there is a bug or a problem

> > with

> > > chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> > > Can you help me out here?

> > >

> > > here is the vb-code for the page load routine

> > >

> > > 'Put user code to initialize the page here

> > > Dim conPrins As New

> > >

> >

> SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> > > _db2")

> > > Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend",

> conPrins)

> > > Dim dtr As SqlClient.SqlDataReader

> > > cmdSelect.CommandType = CommandType.StoredProcedure

> > > cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> > > cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> > > cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> > > conPrins.Open()

> > > dtr = cmdSelect.ExecuteReader

> > > Chart1.DataSource = dtr

> > > 'DataGrid1.DataSource = dtr

> > > 'DataGrid1.DataBind()

> > > dtr.Close()

> > > conPrins.Close()

> > >

> > > Regards

> > > Bas Volkers

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

Hello,

You are right, this is the correct news group.

Likely the reason why this is failing is due to ChartFX not recognizing any valid numeric value within the DataReader to chart. You should specify how each column in the table should be used by ChartFX by using the DataType method. Below I have copied some code from our passing data sample that comes with ChartFX Lite for ASP.Net.

Dim myConnectionString As String

Dim ds As New System.Data.DataSet()

myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("") + "..\Data\ChartfxSamples.mdb"

Dim mySelectQuery As String = "SELECT Projected, Sales,peak from DemoSales"

Dim myConnection As New System.Data.OleDb.OleDbConnection(myConnectionString)

ds = New System.Data.DataSet("Sales")

Dim adapter As New System.Data.OleDb.OleDbDataAdapter()

adapter.SelectCommand = New System.Data.OleDb.OleDbCommand(mySelectQuery, myConnection)

Chart1.DataType(0) = DataType.Value

Chart1.DataType(1) = DataType.Value

Chart1.DataType(2) = DataType.Value

adapter.Fill(ds)

With Chart1

.DataSource = ds.Tables(0)

.Gallery = Gallery.Area 'It requires: Imports SoftwareFX.ChartFX.Lite.Gallery

End With

Chart1.DataBind()

"Scott Leslie" <scott.leslie@sepa.org.uk> wrote in message news:3u9hiSCkDHA.3600@WEBSERVER1...

> which newsgroup do we use for chartfx lite for ASP.net?

>

> "SFX Tech Support" <support@softwarefx.com> wrote in message

> news:w8%23OjrciDHA.3600@WEBSERVER1...

> > Hello,

> >

> > ChartFX Lite is a WindowsForms only control and can not be used in a

> > webpage.

> >

> > JT

> > Tech. Support

> >

> > "Bas Volkers" <basvolkers@admworld.com> wrote in message

> > news:1BZlQt0gDHA.1496@WEBSERVER1...

> > > I'm having problems with populating my chart. I'am using MS visual

> > > studio.net for my webpage design. When I run my application I can see a

> > > chart and there are no error massages. Only the chart data seems to be

> > > random and not a representation of my data. If I bind the datareader to

> a

> > > datagrid I do see the correct data. I think there is a bug or a problem

> > with

> > > chartfx that it wil not bind the DataSource to a SqlDataReader?!?

> > > Can you help me out here?

> > >

> > > here is the vb-code for the page load routine

> > >

> > > 'Put user code to initialize the page here

> > > Dim conPrins As New

> > >

> >

> SqlClient.SqlConnection("server=prins;uid=sa;pwd=telperion;database=wpi_koog

> > > _db2")

> > > Dim cmdSelect As New SqlClient.SqlCommand("sp_procesvaluetrend",

> conPrins)

> > > Dim dtr As SqlClient.SqlDataReader

> > > cmdSelect.CommandType = CommandType.StoredProcedure

> > > cmdSelect.Parameters.Add("@objecttag", "TI600E27")

> > > cmdSelect.Parameters.Add("@begintijd", "9/1/2003")

> > > cmdSelect.Parameters.Add("@eindtijd", "9/2/2003")

> > > conPrins.Open()

> > > dtr = cmdSelect.ExecuteReader

> > > Chart1.DataSource = dtr

> > > 'DataGrid1.DataSource = dtr

> > > 'DataGrid1.DataBind()

> > > dtr.Close()

> > > conPrins.Close()

> > >

> > > Regards

> > > Bas Volkers

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...