Sharepoint to call a SQL stored procedure? - stored-procedures

I'm completely new with SharePoint. How can I create a new page where the user can essentially click a button that will call a stored procedure on the same server? Am I going to need to create an ASP.NET application?
SharePoint 2007 and SQL Server 2008

SharePoint Designer will allow you to put a DataViewWebPart on a page and let you tweak it endlessly. The DataViewWebPart can be populated from all sorts of data sources including SQL databases so it might be able to meet your needs.

You could create this as a webpart. There's a built-in project type for a SharePoint Visual WebPart. Would this be just a single button that always executes the same stored procedure? Does there need to be a list of procedures to choose from? Would the list always be the same, or would it need to be populated dynamically?

Related

ReportViewer's ReportParameter in MVC 5

I am working on a solution where we have to show the filter data of ReportViewer in MVC application. We have SSRS reports hosted in SSRS server. I am able to show the report viewer in MVC application. On top of this, we need to filter the data's in the ReportParameters based on the user's permission. Since we dont want to store the copy of .rdlc file, we cannot alter the reportparameter list as it is a readonlycollection.
Is there a way we could apply the filter
you could try adding a hidden parameter to the report that will be used by the parameter dataset list for filtering and that way you can control it by code. Check this article regarding parameters and filtering.
https://learn.microsoft.com/en-us/sql/reporting-services/tutorial-add-a-parameter-to-your-report-report-builder
Regards

Missing SharePoint Server Publishing Infrastructure feature in SharePoint 2007

I am trying to display a sql query result on a page in my Sharepoint site. After looking around I found instructions on how to do that using the Content Query Web part. The instructions to enable that feature instructions here include activating the SharePoint Server Publishing Infrastructure. I currently don't have that option. Is there something I can install to my sharepoint site to get that option? Is there a better/easier way to display the results of a sql query in sharepoint?
Make sure to look in your "site collection features" instead of your site feature. This feature needs to be activated at the root level of the site collection.
FYI the Content Query WebPart only retrieve content from your site collection (by crafting a relevant CAML query, which is finally transformed to SQL query). You don't have the possibility to create a direct sql query and receive the result.
If you need to query another database than the one SharePoint is using (avoid accessing it from SQL at all cost !), you'll need to rely on the Business Connectivity Service, a data view webpart (using SharePoint designer), or create a simple webpart that will be responsible for everything (connecting to the db, doing the query and rendering the result in any way).
Hope it helped.

How to Submit Data through InfoPath Form to an MS Access Database on Sharepoint 2007 (MOSS 2007)

Maybe I just haven't figured out the InfoPath paradigm yet, but any links, or answers would be extremely grateful.
Here is my intent: Publish an Access Database on MOSS 2007, and then have InfoPath forms submit and retrieve data from that Access database. How is this achieved?
It would be much easier to allow the Infopath form to submit to a Sharepoint document library and use the document library to expose and distribute the data.
If you truly must have content in an access database, that you store inside Sharepoint, which means you are basically storing it inside of sql serverm I would look into writing an event receiver for the document library you post the infopath forms into and let it extract the data and update the ms access database.
As far as the reference data, could you put that into lists in Sharepoint?
Providing this data in Ms Sql for Infopath would be the best approach, but using
Sharepoint lists will be easier to develop.

How to call stored procedure in crystal reports using C#

I am able to create a crystal report for a single table call from C#.\
But I have to call generic stored procedure or a single stored procedure. How can I do this?
Do we can acheive this using XML files also? I mean .. the details abt which table the SP is referring to and if I want to dump the data to excel sheet, which cells the data needs to be inserted.
I have XML for my tables also. Now I hav to call stored procedure in crystal reports.
Please suggest me doin this
Thank you,
Ramm
I'm not sure that I totally understand the question so I'll answer it the best I can.
Try this link to help you get started on what you are looking for.
http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx
You can report off of xml data if needed by using the XML connection in the datasources screen.
Edit:
If are just trying to connect the report to an sp then you should be able to do it using the OLE DB ADO connector and SQL Server provider. Once connected you should be able to navigate down to the stored procedures and add the one you want as a selected table. Then simply add the fields to the report detail section and format it so that it exports properly to Excel. Hope this helps.

How to extract a SharePoint list items into GridView

I need to extract the data from a SharePoint List and view it in a GridView ASP control or any other data table control, how to use the SharePoint API to extract the items from the SharePiont list and demonstrated in a ASP control
There are 2 options:
Using the SharePoint object model, but that is only useable if you are on the same server as sharepoint is.
Generally you would use the SPList object's GetItems method, which takes an SPQuery, that in turn uses a CAML query to specify exactly which items you want returned, i.e. akin to a SQL SELECT statement. for more info check out the SPList.GetItems(SPquery) article on MSDN
The other option is to use the Lists.asmx Web Service to query a list. The web service can be called from another machine. For more info check the MSDN article

Resources