Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Friday, March 30, 2012

How do i add my database to "data sources"?

In Lesson 9 as you can see here (at 16:50), a connection is created against his .mdf database, and the dataset is shown in the "Data Source" window/panel.
He can then simply drag the data source onto the form, and controls are created and bound automaticly - or drag them as a datagridview to the form.

That is what i want to do, but i have some problems...

I have set up a connection to my SQL Express database, and a dataset is created without problems. The problem is that this dataset does not show up in "Data Source". Actually, i have never seen anything in that panel before, in any of the data sources i have added!

What am i doing wrong? In the menu i click "Data" --> Add new data source --> finish the "wizard". Then i click "Data" --> Show Data sources --> It's EMPTY!

Does this also happen if you just connect to a regular database, not through .mdf file? When i tried it with regular database it works, but although "Data Source" panel is not empty, it contains only DataSources names which are empty inside and not possible to drag onto designer. Is it what you mean by "empty"? If so, then you can click on "Server Explorer" and drag and drop your dataset from there. Then your data sources are going to get populated also.|||

I am trying to connect to a regular database, stored on a different computer running MSSQL Express. Connection and everything is okay.

By "empty", i mean completely empty - theres nothing in the panel - no items at all.

See this screenshot:

http://dritbra.com/temp/datasource.png

As you can see on the screenshot, the items appears as soon as something else than the form designer is active...

Btw, when viewing the server explorer i can't drag the items to the form... The mouse has this "not allowed" icon.

|||So theres really no one who can even confirm that the data set is supposed to appear in the data source panel, available for "drag and drop"?|||

Ok, this appears to be a known issue - probably occuring because i have had a beta installed (allthough i have completely reinstalled final version two times on this computer).

SOLUTION:

OPEN:
C:\Documents and Settings\<UserName>\Application Data\Microsoft\VisualStudio\8.0\DataBindingSetting\WinFormControls.xml

ADD THIS:

<DataType Name="System.Collections.IList">
<BindableControlInfo Name="DataGridView" Type="System.Windows.Forms.DataGridView" AssemblyName="System.Windows.Forms, Version=2.6.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<BindableControlInfo Name="[None]" Type="Microsoft.VSDesigner.Data.BindManager.NoneControlPlaceHolder" />
</DataType>

How do i add my database to "data sources"?

In Lesson 9 as you can see here (at 16:50), a connection is created against his .mdf database, and the dataset is shown in the "Data Source" window/panel.
He can then simply drag the data source onto the form, and controls are created and bound automaticly - or drag them as a datagridview to the form.

That is what i want to do, but i have some problems...

I have set up a connection to my SQL Express database, and a dataset is created without problems. The problem is that this dataset does not show up in "Data Source". Actually, i have never seen anything in that panel before, in any of the data sources i have added!

What am i doing wrong? In the menu i click "Data" --> Add new data source --> finish the "wizard". Then i click "Data" --> Show Data sources --> It's EMPTY!

Does this also happen if you just connect to a regular database, not through .mdf file? When i tried it with regular database it works, but although "Data Source" panel is not empty, it contains only DataSources names which are empty inside and not possible to drag onto designer. Is it what you mean by "empty"? If so, then you can click on "Server Explorer" and drag and drop your dataset from there. Then your data sources are going to get populated also.|||

I am trying to connect to a regular database, stored on a different computer running MSSQL Express. Connection and everything is okay.

By "empty", i mean completely empty - theres nothing in the panel - no items at all.

See this screenshot:

http://dritbra.com/temp/datasource.png

As you can see on the screenshot, the items appears as soon as something else than the form designer is active...

Btw, when viewing the server explorer i can't drag the items to the form... The mouse has this "not allowed" icon.

|||So theres really no one who can even confirm that the data set is supposed to appear in the data source panel, available for "drag and drop"?|||

Ok, this appears to be a known issue - probably occuring because i have had a beta installed (allthough i have completely reinstalled final version two times on this computer).

SOLUTION:

OPEN:
C:\Documents and Settings\<UserName>\Application Data\Microsoft\VisualStudio\8.0\DataBindingSetting\WinFormControls.xml

ADD THIS:

<DataType Name="System.Collections.IList">
<BindableControlInfo Name="DataGridView" Type="System.Windows.Forms.DataGridView" AssemblyName="System.Windows.Forms, Version=2.6.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<BindableControlInfo Name="[None]" Type="Microsoft.VSDesigner.Data.BindManager.NoneControlPlaceHolder" />
</DataType>

Wednesday, March 7, 2012

How can I use SQL reporting Services to get a dynamic dataset from another web service as my rep

I found out the data I need for my SQL Report is already defined in a dynamic dataset on another web service. Is there a way to use web services to call another web service to get the dataset I need to generate a report? Examples would help if you have any, thanks for looking Smile

I think this technical article may help you.

http://msdn2.microsoft.com/en-us/library/aa964129.aspx

Simone

|||Thank you very much, this is almost exactly what I was looking for, not 100% but closer then I have been for weeks now. I just need to try and figure out now if I can send a parameter to a web service now to get the result set I need. Again, thanks... Smile

Friday, February 24, 2012

How can I use one table for mutliple datasets?

Hi All,
I have a table and the dataset it populating all but four cells. These
four cells I want to populate using data from a different dataset (I
couldn;t figure out a query to do what I needed). The main dataset
returns a value I can use as a parameter in the second dataset. Is this
clear? Is this possible. I'm new to this type of reporting so please
bear with me. Thanks!
Kind regards - FredYou can create a sub report and put that in a cell of the table object. I do
this all the time. Sub reports are the only way to link two datasets
together.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<fblock@.tellurian.com> wrote in message
news:1164903187.594743.309230@.l39g2000cwd.googlegroups.com...
> Hi All,
> I have a table and the dataset it populating all but four cells. These
> four cells I want to populate using data from a different dataset (I
> couldn;t figure out a query to do what I needed). The main dataset
> returns a value I can use as a parameter in the second dataset. Is this
> clear? Is this possible. I'm new to this type of reporting so please
> bear with me. Thanks!
> Kind regards - Fred
>|||Thanks Bruce...
I see that I cannot merge cells vertically and the sub-report would
need to be two cells (one over the other). Have you a trick for this.
Also - why is it that my dataset field is "First(field_name)"... Why
the "First()"? The VS IDE was complaining of an aggregate which "sort
of" makes sense but my dataset was onle able to return one row (it
used: TOP 1).
Thanks again!
Kind regards - Fred|||Your subreport can have multiple cells. You create your subreport using the
table control with one cell over the other. You embed it into a single sell
and that cell grows vertically. However, if you are wanting the bottom cell
to line up with the second detail row you can't do it. It will expand the
cell you put it in and then your second detail row of the master will show.
You could have two subreports but remember, it is calling this subreport for
every row.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"frblock" <frblock@.yahoo.com> wrote in message
news:1164915731.670399.153450@.79g2000cws.googlegroups.com...
> Thanks Bruce...
> I see that I cannot merge cells vertically and the sub-report would
> need to be two cells (one over the other). Have you a trick for this.
> Also - why is it that my dataset field is "First(field_name)"... Why
> the "First()"? The VS IDE was complaining of an aggregate which "sort
> of" makes sense but my dataset was onle able to return one row (it
> used: TOP 1).
> Thanks again!
> Kind regards - Fred
>|||frblock,
You asked why you needed to have an aggregate function in the field
expression. Perhaps this will help.
When you create a report through the report wizard, it automatically
creates a table on your report. That table is actually "bound" to a
dataset. This binding allows you to reference fields from that dataset
by just saying "=Fields!fieldName.Value". This binding also tells the
table to create 1 detail row for each datarow in the dataset.
Microsoft included the ability to reference other datasets from a table
that has already been bound to a different dataset, but there is no way
to "relate" the rows from the 2 datasets. You would need a sub-report
to do this. As a result, you have to use a scalar function to ensure
that you get only 1 row and 1 column back, and you also have to
explicitly state which dataset you want to use. The formula looks like
this: "=Sum(Fields!fieldName.Value, "Dataset1").
If you are trying to reference fields that belong to the dataset that
is already assigned to your table, in the Edit Expression window, you
should select the "Fields (Dataset1)" option. If you are trying to
reference fields from other datasets, then you choose "Datasets". The
default aggregate function for integer fields is Sum, and the default
for string fields is First. You can change the default. For example, if
you had a query that said "SELECT COUNT(*) FROM tableName", you could
use First, Min, Max, Avg, or Sum. My opinion, just stick with First.
HTH,
Josh
frblock wrote:
> Thanks Bruce...
> I see that I cannot merge cells vertically and the sub-report would
> need to be two cells (one over the other). Have you a trick for this.
> Also - why is it that my dataset field is "First(field_name)"... Why
> the "First()"? The VS IDE was complaining of an aggregate which "sort
> of" makes sense but my dataset was onle able to return one row (it
> used: TOP 1).
> Thanks again!
> Kind regards - Fred