Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Thursday, March 8, 2012

assigning datasetname dynamically to a report ?

Hi friends
am new to reports in VS2005.
how can i assign a datasource dynamically to a report.
i know how to do add datasource in desgin mode to a report.(i.e i create a new datasource and drag and drop it on to report).

but in my case i need to take some parameters from users and create a dataset with relavant data and show it in a report.
i cant find any documentation or samples for it.
Thanks for your help.
BTW its winform application and i want to show that report in report viwer control.
Thanks for your helpFinally i found a way to do this.
first i created typed dataset and bound it to my report. and in my screen i populate this typed dataset with data and load the report in report viewer control.
my sample code

reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
reportViewer1.LocalReport.ReportEmbeddedResource = "WindowsApplication1.samplereport.rdlc";
reportViewer1.LocalReport.DataSources.Add(
new ReportDataSource("MyTable", GetData()));
this.reportViewer1.RefreshReport();

in getdate() method i loop thru my data reader and populated the typed dataset .

is this right approach i.e. using typed dataset and is there any better approach of doing it.
Thanks for your ideas.

Saturday, February 25, 2012

ASPNETDB.MDF?

Using VS2005, VB backend and javascript,

I have developed a relatively simple site - its got a few (12) simple aspx pages but its mostly client side javascript. Keeping disk storage costs down is a big concern with this my site. The disk usage for the site is ~24M. Since this was larger than I expected I started inspecting the files comprising my site and found that the "ASPNETDB.MDF" in my "App_data" folder is consuming 10.2M by itself. The thing is that site only has a few pages with calls to SQL Server - but I never did anything (that I know of) with ASPNETDB.MDF. Through VS2005, I opened up the MDF file and poked around, everything that I looked at was empty (NULL).

So my questions are:

What is causing the ASPNETDB.MDF to consume 10.2M even thought I can't see any data stored in it?Is there anyway for my to reduce the size of this file? If so, how?

Your input appreciated.

Should I be posting this in a different forum?|||

Hi,

The ASPNETDB contains a lot of information about table structure and membership information about your site.

To check what is occupying the storage, you can run DBCC CHECKDB on your local machine to see the allocation, structural, and logical integrity of all the objects in the specified database.

For more information, please check the following link.

http://msdn2.microsoft.com/en-us/library/aa258278(SQL.80).aspx

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

Friday, February 24, 2012

aspnetdb connection string

Hello,
I'm getting up to speed with VS2005 and use SQL Server 2005. I'm using the login control in a test web app.

When I run the app I get this error:

Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'UserID\ASPNET'.

The connection string I'm using is:

data source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;

The AspNetSqlProvider in the web administration tool connects to the database.

My question is, Is this a connection string issue, and user ID issue, a rights issue or is it something else?

Thanks,

Gaikhe

This is a permission issue on SQL, which indicates theUserID\ASPNETlogin dose not have sufficient permission to perform specific task(access in this case) on theaspnetdb database. You should add database mapping for this account to theaspnetdb database: open ManagementStudio->Explore the SQL instance->Security->Logins->view the properties of theUserID\ASPNETlogin->switch toUser Mapping tab-> add proper mapping and permission to the login.