Getting started with SQL Server Reporting Services - asp.net

I'd like to set up SQL Server Reporting Services but I don't know where to start. The books out there are okay but don't seem to fit what I need to do. That is, I want to set up my ASP.NET 3.5 application to be able to view reports I create, both in a web report viewer and downloadable as PDF/Excel.
What are the basic steps to do this? Do I need IIS installed on the SQL box?

Reporting Services for SQL Server 2005 is built on top of IIS. Reporting Services for SQL Server 2008 is not, but you may still need IIS installed anyway; I seem to remember that the install process checked for IIS as a precondition.
What version of SQL Server are you using? I assume that you have a version with reporting services, but just to verify, the Express editions don't have it. SQL Server developer edition is the cheapest way to go; it's usually available on Amazon for something like $45. Developer edition has everything, but with a restricted license.
I haven't messed with reporting services much (it's on my list, but never seems to get to the top of the list). However, the 2008 version uses Visual Studio 2008 for developing reports (renamed as SQL Server Business Intelligence Development Studio). Once you have all that installed, you should be good to go.

You can access the SSRS implementation via a SOAP API.
http://msdn.microsoft.com/en-us/library/aa256607(SQL.80).aspx
This should allow you access to reports via a report viewer which you has built in means for exporting to pdf / excel etc.

Install it from the main SQL Server installer. Make sure you also install the client tools on the machine you'll be using for development.
Use Visual Studio (or BIDS) to create and deploy your reports. There are standard templates to get you started.
When you access the reports over the web, you will have the option of downloading them as PDF or Excel (no special settings or code is required)
Embedding reports in an ASPX page takes a little more work. When you get past the items above, post another question about the details (it mainly involves a couple of special controls).

The ASP.NET ReportViewer control can operarate in two modes, local or remote. In remote mode it will display reports from a SSRS server, in local mode you can add the reports directly to your visual studio project and the control will handle the rendering. This might be more suitable if you don't want to install IIS.
In my experience it is easier to create the reports in remote mode but in local mode you can use business objects as a data source.
Have a look at http://www.gotreportviewer.com, this has a good explanation and links to other resources and sample code.

Related

Are there any file-copy deployable web servers that can serve Asp.Net MVC content?

I have been using the Uniform Server for doing local development without any huge commitment or any server-style footprint on my dev box.
I'd like to enable a similar experience for Asp.Net MVC 3 and Razor development. But I'd like to avoid installing IIS, SQL Server, and Visual Studio. I'd like to avoid installing any server software, except via a file copy. The express versions of VS aren't an improvement, for example.
I can deal with having to install frameworks, like the .Net Framework 4.0, MVC3, etc.
Questions:
Is there any existing software capable of this? Is it possible to bend my existing Apache file-copied deployment to do this and work with the .Net Framework?
If not, what is the least I could get away with? Is it possible to install some version of the Asp.Net Development Server without installing full IIS, SQL Server, and Visual Studio?
Reason:
My hosting provides PHP and Asp.Net support only, and I don't really want to use PHP. I don't want my in-development or throw-away projects to be public, so I'm not going to use my hosting for development. I also want to enable the whole "wipe it clean and start fresh by wiping a directory" development workflow.
On the web server side, the closest approach I know of to what you're suggesting is probably IIS Express.
For the database, have a look at SQL Server Compact Edition -- it's an embedded version that shouldn't require installation.
I believe Cassini is what you are looking for. While I haven't got around to using it, for exactly the same target (MVC 3), it has been sitting in my findings a while now, so please report back if you actually use it with MVC3!
As for a database solution, I would go with an embedded sql ce 4

Which database to use for C# ASP.NET website?

I am developing an online internal web portal (like users write tests, provide document links to study, completing a study roadmap, admin user to view ststistics, etc). It caters some 150 users. I have planned to use ASP .NET with c# in Visual Studio 2008 on windows xp. I am implementing using Forms and NOT MVC since I feel at home with forms.
I do not want to use windows authentication since each user will have many attributes related to him and so it will be easy using a database. Security is not an issue since it is being used internally only.
I have only a fair knowledge about ASP and C# and VS 2008.
Now my questions:
Can I use MS SQL server database that is built in in VS 2008?( I cannot ask for external databases)
Can I export the website totally along with the databases to IIS server running in some other computer? How?
Do I need to export databases separately or provide a database creation script like PHP?
(I have more questions. Will update once I start off).
(This is my first .net web app. so can i know where i can find login scripts, pagination, examples, and pretty much all the stuff)
edit: which to use? New website or New Webapplication?
You can pretty much use any database, but it seems from your requirements that you want to look closer towards something like SQLExpress, SQL Server Compact Edition or SQLLite.
Can I export the website totally along
with the databases to IIS server
running in some other computer? How?
Your database will be shipped along with your application if you use one of the database options that I have specified above.
Do I need to export databases
separately or provide a database
creation script like PHP?
See my comment above, the database will exist when you deploy your website to IIS. It's a physical file that will be in your APP_DATA folder.
You can use:
MySQL. The reason: It has no space or memory limit!
SQL Server or SQL CE. These are both alike. They just differ in slite functions, and also the storage!
The SQL CE allows you to have 4GB. But the SQL Server lets you have 10GB.
So it depends on your work!
Also, I wanted to point out one error in a post, that the SQL CE is present in App_Data, Correct! But the SQL Server is placed somewhere like:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\here_will_it_be
And yes, you can migrate it to wherever you want to place it. I mean if you want to upload it to a hosting server, you can upload it using Web Deploy! Or what ever service. When downloading you will have to repeat same process!
I hope you are doing good with your first web app! :)

SQL server express backend for ASP.NET web service

I come from a linux/apache/php/mysql background. For my current project, I am forced to write web services using ASP.NET. I have installed visual studio and created an ASP.NET web service project. The web service I'm creating will use a SQL database backend. I see that visual studio installed "SQL Server Express 2008." I can see that there is a service called "SQL Server (SQLEXPRESS)" that is running. My question is, how do I run queries against this database? Where's the front end? What tool do I use to create databases and tables? Is there something else I have to install?
I feel completely lost and my google-fu fails me. There are so many different SQL products from microsoft that I can't tell what is the easiest path to just having a simple database with tables I can query from my development machine. With MySQL, I would install the MySQL database, download MySQL query browser and start firing queries at it. How can I do that with Visual Studio/SQL Server Express?
You can download SQL Server Management Studio from here. This is the GUI for working with SQL Server. It will let you create databases, tables, stored procedures, etc. as well as writing queries and manually edit data in the tables.
Aside from SQL Server Management Studio, you can use the Server Explorer tab in Visual Studio (by default on the right side, next to Solution Explorer) to add a data connection. You can do most of the most common database tasks (create/query tables, create views, etc) from there.
there's a command line tool that installs with SQL Server (all versions) called SQLCMD.exe, should be in your install path.
Visual Studio also lets you create dbs, run queries, look at table structures and data (including creating and deleting them, etc), you do that by opening your Server explorer window and making a connection to your local instance (.\SQLExpress by default).
Finally, as the other person mentioned, SQL Server Management Studio Express is a free download, and well worth the time it takes to install.

Best practices for maintaining shared hosting websites with ASP.NET and SQL Server?

I've been doing PHP/MySQL websites with shared hosting providers for the last couple years. The day-to-day process is basically:
develop in Eclipse, one website per folder
upload via FileZilla, one website per folder
use PHPMyAdmin to create and manage your local and online databases and transfer data from one to another
to backup the online database I do dump of the database tables into script and copy them locally
I now want to build websites with ASP.NET with SQL Server 2008 on shared hosting providers, and am trying to get into this new paradigm, hopefully some of you can give me some pointers based on your experience and tell me what I am not doing optimally:
I've installed both the Visual Web Developer 2008 Express as well as the full version of Visual Studio 2008, both seem to be full-featured tools for developing ASP.NET sites. In terms of websites at shared hosting providers, what can you do with the full version that you can't do with the express version?
I use FileZilla to upload my sites, which seems to work fine. Do you use an external FTP program to upload your sites or do you use the "Publish" or "FTP Website" in the above IDEs?
I installed SQL Server 2008 Management Studio and can now issue SQL commands to my online SQL Server database (although I strangely can't see my database in the list on the left, I can still access it, I assume this is some rights issue with my provider, www.domainbox.de, but this provider told me to use their online manager instead, which is called "ASP.NET Enterprise Manager" which is extremely simple but at least has a "Query Box" which allows me to send queries to my database.) Is this "ASP.NET Enterprise Manager" standard with ASP.NET hosters or is there something else that is better, e.g. where you could edit your data in the grid, etc.? And I assume that with most providers you are able to manage your online SQL Server database with SQL Server Management Studio, is that correct? (I remember back in 2001 managing online SQL Server 2000 database at a shared hosting provider with Enterprise Manager and it would take literally 10 minutes for me to see my database on the left because it listed out the other 800 customer databases as well -- hopefully this has been solved by now).
How do you backup your data in your online database to local storage? (currently I would have to write code that output my data to some other format, e.g. XML or SQL Script)
And after you make a number of structural and data changes to your local database, how do you transfer those changes and the new data to your online database? (I had to install SSMS Tools [http://www.ssmstoolspack.com] to be able to dump my data into a script so that I could get it back into my online database).
So, although I've gotten most things to work, I feel like there must be better ways to go about this, better providers, better tools, etc. Would like to hear some "best practices" advice from anyone who works with ASP.NET, SQL Server and shared hosting.
For the most part, what you're doing now will work with an asp.net website.
For your development environment, I don't think you will be limited by using Visual Web Developer 2008 express for what you want to do. Here is a microsoft page that compares every version of visual studio 2008, including Visual Web Developer 2008 Express: Visual Studio 2008 Product Comparison
For deploying your website over the net, I would generall stick to deploying manually. You can use some of the automated stuff in visual studio, but your deployment will tend to be a little slower. After compiling your application, it will then delete every file in your destination website, and upload everying from scratch (uncompressed I think). Your whole site will be down while this happens. When you deploy manually you can upload just the changed files, or everything in a compressed format.
Regarding the SQL server, many shared hosting services will let you connect with some sort of local SQL management tool. However, connecting this way generally uses a lot of bandwidth so they throttle the allowed bandwidth for this way down. This is probably the performance issues you previously saw. If you can get by with it, I would use their hosted SQL tools for most of your work, but then use the management studio for anything it can't handle.
For backing up your SQL server, if your host doesn't have a way for you to perform an automatic backup then you will have to do something yourself. I would first check to see if they will allow you to at least run a SQL backup command. This will generate a .bak file of your database, but on the local database server. Most places will work with you on this, since many customers need this.
For applying changes to your database, your best bet is to script all of the changes into one sql script and run it using the remote SQL management tool. These aren't hard to write, and there are a few tools out there that will help you with it. I personally like to use Visio. It lets me compare two databases (local and remote) then generate a script to apply to the remote one with all the changes.
Good luck
As far as capabilities of VS Express vs Standard - Standard is still the better tool. It gives you a richer debugging experience, broader support for solutions/projects dependencies among other things.
These things still matter even when doing shared hosting b/c you absolutely need to debug your app (client and server side). You can do this adequately with Express with some caveats (cant attach to an arbitrary process, client side javascript debugging is a pain), Standard makes this MUCH easier.
For publishing/deploying - I would recommend 'Web Depoyment Projects' - an MSBuild extension that you can download from MS. This gives you a lot of customizability of how you want to build and deploy your website - which can include sending it to an FTP site. If you have ever used MSBuild and like it - Web Deployment Projects are the easiest hook to extend your build process with an ASP.NET website.

How do I use ASP.NET with Visual Studio 2008

I haven't used Visual Studio since VB 3 and am trying to give it a shot with ASP.NET. It seems that it should be able to connect to a website (via some sort of ftp like protocol I figure) and allow to edit without having to manually upload/download the files. Is this the way it is supposed to work or am I mis-understanding? I have tried using 'create new website' and 'open website' using my testing domain (hosted by godaddy, wondering if that may be the issue as well), each time it gives me errors. I'm not sure if I'm doing something wrong or trying to do something it wasn't meant to.
You really don't want to be working directly on a live web site, do you? That's just crazy. One little mistake and you've hosed the site.
Visual Studio now has it's own built in web server. You use that for testing. If you really don't want to use that you can put IIS on your local machine or set up a Dev/QA server somewhere. In that case, you'd edit it via a file share.
You should be using some kind of source control. Even for a single developer it's very important. When finished with a programming session, you check your updates back into source control.
Finally, only after the site's gone through a suitable QA process, the production server is updated from source control, not from within visual studio.
I would develop your website locally and ftp it to your godaddy website after or use the publish website feature in VS

Resources