Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Sunday, March 25, 2012

calling report in asp.net app

Hello,
I created a few reports by using RS2000, now I want to call these reports in
my asp.net web application through a selection box. What is the best and
easiest way to handle this.
Thanks,
Jim.if you want a dynamic list (a list constructs from the reports available) so
you can access RS through its webservice and retrieve the list of available
reports
Or if the list is limited , then you can fill manually the selection box
with "static" values.
To open and render the report, if the ASP.NET application is on the same
server as RS, then simply open the report with URL access:
/reportserver?/folder/report name
You can use the sample ASP.net control provided with RS to disply the
report.
"JIM.H." <JIMH@.discussions.microsoft.com> a écrit dans le message de news:
185467F1-14DD-4658-A5EE-A2024FC6290D@.microsoft.com...
> Hello,
> I created a few reports by using RS2000, now I want to call these reports
> in
> my asp.net web application through a selection box. What is the best and
> easiest way to handle this.
> Thanks,
> Jim.
>|||Jim,
Easiest may not always be the best way since it depends on your report
requirements. But in general, you should gravitate whenever possible to URL
addressability. The ReportViewer sample that comes with RS makes this
easier.
If you want to be able to switch between URL and SOAP addressibility you may
find my AwReportViewer control (an enhanced version of ReportViewer useful
(http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=45). Enjoy
it!
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:185467F1-14DD-4658-A5EE-A2024FC6290D@.microsoft.com...
> Hello,
> I created a few reports by using RS2000, now I want to call these reports
in
> my asp.net web application through a selection box. What is the best and
> easiest way to handle this.
> Thanks,
> Jim.
>

Thursday, March 22, 2012

Calling program from SQL Stored Procedure

Hello,
I don't know if this can be done, I'm not an SQL Server expert; But can you
start a program ( VB app ) with a stored procedure.
For instance if a record is written to a sql table then a trigger could be
set to start a vb app from sql'
I'm trying to come up with a way to recognize an insert to a sql table and
this insert would start a vb app which would perform tasks and write
additional fields to the table...
Any help would be welcomed... Thanks
--
T HYou can, but it is very very ill advised.
If the application fails, the transaction gets rolled back.
If your application takes 30 seconds to execute, SQL Server has to hold the
locks, severely impacting transactional throughput.
Your application, as it is outside SQL Server could end up waiting on locks
on rows in the DB that actually launched it.
If you have 100 users working against the table, you could potentially have
100 instances of the application launched by the trigger.
Rather write the record to another table and have an external application
poll the table and perform the functions.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Monster T" <MonsterT@.discussions.microsoft.com> wrote in message
news:6AA60AD3-1EF4-466D-A620-6D49075BD661@.microsoft.com...
> Hello,
> I don't know if this can be done, I'm not an SQL Server expert; But can
> you
> start a program ( VB app ) with a stored procedure.
> For instance if a record is written to a sql table then a trigger could be
> set to start a vb app from sql'
> I'm trying to come up with a way to recognize an insert to a sql table and
> this insert would start a vb app which would perform tasks and write
> additional fields to the table...
> Any help would be welcomed... Thanks
> --
> T H|||You can use xp_cmdshell which can be used to execute programs, esp. if it is
non-interactive and has no ui. See SQL Server Books Online for more details
on xp_cmdshell.
However, based on the narrative, you might want to get some advice on your
overall application design before implementing such convoluted steps.
Triggering a VB app which in turn process data & insert data into tables
sounds like a bad idea.
Anith|||Even if you did call the app, it would be running on the server box and apps
that build recordsets can be memory hogs and security risks. Instead, write
the additional fields using T-SQL.
"Monster T" <MonsterT@.discussions.microsoft.com> wrote in message
news:6AA60AD3-1EF4-466D-A620-6D49075BD661@.microsoft.com...
> Hello,
> I don't know if this can be done, I'm not an SQL Server expert; But can
you
> start a program ( VB app ) with a stored procedure.
> For instance if a record is written to a sql table then a trigger could be
> set to start a vb app from sql'
> I'm trying to come up with a way to recognize an insert to a sql table and
> this insert would start a vb app which would perform tasks and write
> additional fields to the table...
> Any help would be welcomed... Thanks
> --
> T H|||Has anyone seen any information on calling a .NET application from within a
stored procedure? For instance, is there a way a stored procedure could cal
l
a Web Service?
What we have in our situation is a process/custom application that needs to
be launched as soon as the database completes an import of data. This
application is launched on a different server from the database server. In
the past we used the OLE stored procedures to call a COM (that was accessabl
e
via DCOM) but we would like to use .NET in this instance instead of the old
COM ways. It seems the only options I'm aware of are:
xp_cmdshell
OLE stored procedures
If that's the case then we can still write the .NET application but we would
have to make it available to the old COM interface. Anyone know of any othe
r
methods?
Regards,
David Gardner
"Mike Epprecht (SQL MVP)" wrote:

> You can, but it is very very ill advised.
> If the application fails, the transaction gets rolled back.
> If your application takes 30 seconds to execute, SQL Server has to hold th
e
> locks, severely impacting transactional throughput.
> Your application, as it is outside SQL Server could end up waiting on lock
s
> on rows in the DB that actually launched it.
> If you have 100 users working against the table, you could potentially hav
e
> 100 instances of the application launched by the trigger.
> Rather write the record to another table and have an external application
> poll the table and perform the functions.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Monster T" <MonsterT@.discussions.microsoft.com> wrote in message
> news:6AA60AD3-1EF4-466D-A620-6D49075BD661@.microsoft.com...
>
>|||Hi David -
Another option for you *may* be Notification Services. Using the SQL
Server Event Provider, you can configure it to monitor a table and
notify you when a certain change has occurred. In your case, that
notification would be a call to another process on another machine.
You'd need to develop a custom delivery protocol for that purpose.
Just something to check out...
HTH...
Joe
Joe Webb
SQL Server MVP
~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/t...il/-/0972688811
I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)
On Tue, 7 Jun 2005 17:00:28 -0700, "David Gardner"
<David.Gardner-Logan@.REMOVECAPSrrd.com> wrote:
>Has anyone seen any information on calling a .NET application from within a
>stored procedure? For instance, is there a way a stored procedure could ca
ll
>a Web Service?
>What we have in our situation is a process/custom application that needs to
>be launched as soon as the database completes an import of data. This
>application is launched on a different server from the database server. In
>the past we used the OLE stored procedures to call a COM (that was accessab
le
>via DCOM) but we would like to use .NET in this instance instead of the old
>COM ways. It seems the only options I'm aware of are:
>xp_cmdshell
>OLE stored procedures
>If that's the case then we can still write the .NET application but we woul
d
>have to make it available to the old COM interface. Anyone know of any oth
er
>methods?
>Regards,
>David Gardner
>"Mike Epprecht (SQL MVP)" wrote:
>sql

Calling my RS "Invoice Report" from c# app question...

I have a parameter to bring up my report now, which works fine.
But I need to add the functionality of bringing up my report from c#
now.
Any help is appreciated.
Thanks,
TrintYou have two options. One is URL integration. For that you embed the IE
control. Then you set the url property to the appropriate value. You can
pass parameters, rendering options etc. Just check out URL Integration in
books on-line. The other option is to use the new reportviewer control that
ships with VS 2005. It has a winform control that is quite easy to use.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"trint" <trinity.smith@.gmail.com> wrote in message
news:1183646995.350764.176420@.w5g2000hsg.googlegroups.com...
>I have a parameter to bring up my report now, which works fine.
> But I need to add the functionality of bringing up my report from c#
> now.
> Any help is appreciated.
> Thanks,
> Trint
>|||On Jul 5, 12:13 pm, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
wrote:
> You have two options. One is URL integration. For that you embed the IE
> control. Then you set the url property to the appropriate value. You can
> pass parameters, rendering options etc. Just check out URL Integration in
> books on-line. The other option is to use the new reportviewer control that
> ships with VS 2005. It has a winform control that is quite easy to use.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "trint" <trinity.sm...@.gmail.com> wrote in message
> news:1183646995.350764.176420@.w5g2000hsg.googlegroups.com...
>
> >I have a parameter to bring up my report now, which works fine.
> > But I need to add the functionality of bringing up my report from c#
> > now.
> > Any help is appreciated.
> > Thanks,
> >Trint- Hide quoted text -
> - Show quoted text -
Can you point me to an example please?|||For URL Integration read up on URL Access in Books On Line(there are a whole
lot of topics and examples)
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsprg9/html/52c3f2a3-3d6d-4fee-9c46-83f366919398.htm
As far as using the IE control in C# you should just google that and get an
example from C#.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"trint" <trinity.smith@.gmail.com> wrote in message
news:1183661710.196713.43980@.w5g2000hsg.googlegroups.com...
> On Jul 5, 12:13 pm, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
> wrote:
>> You have two options. One is URL integration. For that you embed the IE
>> control. Then you set the url property to the appropriate value. You can
>> pass parameters, rendering options etc. Just check out URL Integration in
>> books on-line. The other option is to use the new reportviewer control
>> that
>> ships with VS 2005. It has a winform control that is quite easy to use.
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "trint" <trinity.sm...@.gmail.com> wrote in message
>> news:1183646995.350764.176420@.w5g2000hsg.googlegroups.com...
>>
>> >I have a parameter to bring up my report now, which works fine.
>> > But I need to add the functionality of bringing up my report from c#
>> > now.
>> > Any help is appreciated.
>> > Thanks,
>> >Trint- Hide quoted text -
>> - Show quoted text -
> Can you point me to an example please?
>

Tuesday, March 20, 2012

Calling External App From Sproc or Trigger?

Hi all. Yes, it's me again. LOL

My question is this: Can I program something in the way of a trigger or a sproc that when a certain field is populated (on insert/update) that it calls a VB application or some other external program (possibly a web app?)

If not, does anyone have any suggestions on how I might accomplish this for SQL7? We have actually begun testing to upgrade our 7DBs to 2K, so if it's possible to do something like this in 2K that will also work for me.

Thanks for all the help you guys provide me! I need every bit of it sometimes!

Dirkuse xp_cmdshell in your trigger.

"tnjazzgrass" wrote in message
news:2430444.1043362868@.dbforums.com...
> Hi all. Yes, it's me again. LOL
> My question is this: Can I program something in the way of a trigger
> or a sproc that when a certain field is populated (on insert/update)
> that it calls a VB application or some other external program (possibly
> a web app?)
> If not, does anyone have any suggestions on how I might accomplish
> this for SQL7? We have actually begun testing to upgrade our 7DBs to
> 2K, so if it's possible to do something like this in 2K that will also
> work for me.
> Thanks for all the help you guys provide me! I need every bit of it
> sometimes!
> Dirk
> --
> Posted via http://dbforums.com (http://dbforums.com/)|||As Radzi says you should use the system extended sored procedure xp_cmdshell within a trigger. Something like this will do the trick:

CREATE TRIGGER tr_myTrigger ON dbo.myTable
FOR INSERT, UPDATE, DELETE
AS

DECLARE @.Cmd varchar(1000)
BEGIN
SET @.Cmd = 'c:\..\program.exe'
EXEC master..xp_cmdshell @.Cmd, NO_OUTPUT
END

Cheers!sql

Calling DTS from C#

Hi all,

i have a DTS package that i call from a C# app, i had it working great until i decided to use an activeX script to do the data transformations instead of the row copy.

I need to use ActiveX to add a standard name to the last column in the destination table. the problem is the task is executing without errors (from c#) but nothing is happening, its failing silently. If i modify the Data Transformation back to a standard column mapping (with separate DTSTransformations for each column) it works fine, but as soon as i use activeX to handle the transformations it doesn't work.

Can anyone tell me what i may be doing wrong.

heres the calling code from C#

if(f.Name.Substring(13,7).ToLower() =="product"){try{activity.Log("Starting Product DTS Package..."); DTS.Package2Class package =new DTS.Package2Class();object pVarPersistStgOfHost =null;package.LoadFromSQLServer("192.168.8.8","username","thepassword",Microsoft.SqlServer.DTSPkg80.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default,null,null,null,(string)ConfigurationSettings.AppSettings["productDTSPackage"],ref pVarPersistStgOfHost);package.GlobalVariables.Item(1).Value = f.FullName.ToString();package.Execute();package.UnInitialize();//force release of COM objectSystem.Runtime.InteropServices.Marshal.ReleaseComObject(package);package =null;}catch(Exception e){activity.Log(string.Format("Failureprocessing {0}",WorkingPath + f.Name) +" - "+ e.Message);}

and the activex i tried to use for the transformations is:

'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************

' Copy each source column to the destination column
Function Main()
DTSDestination("Yesmail Id") = DTSSource("product series")
DTSDestination("Customer CKM CustId") = DTSSource("product family")
DTSDestination("Product SKU") = DTSSource("transaction date")
DTSDestination("product model name") = DTSSource("serial number")
DTSDestination("serial number") = DTSSource("product model name")
DTSDestination("transaction date") = DTSSource("Product SKU")
DTSDestination("product family") = DTSSource("Customer CKM CustId")
DTSDestination("product series") = DTSSource("Yesmail Id")
DTSDestination("fileName") = DTSGlobalVariables("sourceFile").Value <-- this is why im using the activex for this field to get a Global Variable.
Main = DTSTransformStat_OK
End Function

the weird thing is the PACKAGE runs fine from ENTERPRISE MANAGER with this activex, it just doesn't do it from my Calling app, perhaps i have missed something i need to change in the package constructor?

BTW: i do have my assembly signed in C# for the COM wrapper.

thanks in advance,

mcm

I have answered here in the other thread the next step and it is not complicated and I have not found anybody who could not get it to run so run a search on this site for setting up the proxy account link. Hope this helps.

http://forums.asp.net/thread/1440879.aspx

Monday, March 19, 2012

Calling a VB exe from a stored procedure

Can someone tell me a straightforward way to call a VB app (that accepts command line arguments) from a stored procedure.

I have got it to work by using xp_cmdshell, but in practice, the security constraints here prevent using this. Our DBAs don't want to set the proxy account required for a non-sysadmin user to eexecute xp_cmdshell.

I know that writing an extended SP invoking a C++ dll would be the cleanest solution. However I don't have the knowledge to do that.

Any ideas?

ThanksOriginally posted by mtnlvrs
Can someone tell me a straightforward way to call a VB app (that accepts command line arguments) from a stored procedure.

I have got it to work by using xp_cmdshell, but in practice, the security constraints here prevent using this. Our DBAs don't want to set the proxy account required for a non-sysadmin user to eexecute xp_cmdshell.

I know that writing an extended SP invoking a C++ dll would be the cleanest solution. However I don't have the knowledge to do that.

Any ideas?

Thanks

I think your opening post eliminated the only two ways to do this (and actually, there's only one, since XP_CMDSHELL is just a very simple extended proc DLL)

Actually, just straight C will do for the DLL. It's not as hard as you seem to think. On the other hand, you gotta be sure of that code, since you'll be running in the engines address space. Just be sure to clean up everything, check your buffer lengths, and initialize all your pointers and it will work just fine. But I'm fairly certain extended procs are the only way to 'step outside' of what TSQL is capable of, ie run your VB code, and retain control flow.

Now, if it's OK for your VB code to run asynchronously, you could always make it step in a SQL Agent Job, and kick it off in a stored proc by executing msdb..sp_start_job, but you won't be able to return anything and your stored proc won't wait on the job to finish. And you'll have concurrency issues, as only one copy of a SQL Agent job can run at a time.

Thursday, March 8, 2012

Callable statements, SQLServer and JRun

Hi,

I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. I use
JRun as the app server. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management'
section
in SQL Server.

The problem is that at the moment if I look at the 'Last TSQL command
batch' in the process or lock, it does not display the sql for the
current call. It displays what seems to be the precompiled call:
#jdbc#9;1

Anyone know how to get it to display the sql?

Is it a driver issue or is there a SQL Server setting to get it to do
this?

Thanks(cormac.foley@.gmail.com) writes:

Quote:

Originally Posted by

I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. I use
JRun as the app server. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management'
section
in SQL Server.
>
>
The problem is that at the moment if I look at the 'Last TSQL command
batch' in the process or lock, it does not display the sql for the
current call. It displays what seems to be the precompiled call:
#jdbc#9;1
>
>
Anyone know how to get it to display the sql?
>
>
Is it a driver issue or is there a SQL Server setting to get it to do
this?


Didn't you ask the same question a week ago or two? Yes, that was
another newsgroup, but at least you should have learnt by now that it
is a driver issue. And I hope that you should know that you should
use parameterised statements.

Well, I see on Google Groups that you also have posted your
question to comp.lang.java.programmer. Too that you did not cross-post.
It would have been interesting to see the answers from the Java folks.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Feb 12, 10:29 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

(cormac.fo...@.gmail.com) writes:

Quote:

Originally Posted by

I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. I use
JRun as the app server. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management'
section
in SQL Server.


>

Quote:

Originally Posted by

The problem is that at the moment if I look at the 'Last TSQL command
batch' in the process or lock, it does not display the sql for the
current call. It displays what seems to be the precompiled call:
#jdbc#9;1


>

Quote:

Originally Posted by

Anyone know how to get it to display the sql?


>

Quote:

Originally Posted by

Is it a driver issue or is there a SQL Server setting to get it to do
this?


>
Didn't you ask the same question a week ago or two? Yes, that was
another newsgroup, but at least you should have learnt by now that it
is a driver issue. And I hope that you should know that you should
use parameterised statements.
>
Well, I see on Google Groups that you also have posted your
question to comp.lang.java.programmer. Too that you did not cross-post.
It would have been interesting to see the answers from the Java folks.
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx- Hide quoted text -
>
- Show quoted text -


He he..u the newsgroup police or something? Yes I asked the same
question last week on Yahoo. Am interested in getting numerous
opinions on this.

I have tried a number of different types of driver and all of them
still result in the compiled sql in the 'Last TSQL command batch'
value. Interestingly when I use Microsoft drivers they seem to compile
everything..and Macromedia drivers just seem to compile stored
procedure calls which have parameters.

I need to use stored procedures/CallableStatements - it may be that is
not possible to have the uncompiled sql available in the log when
using CallableStatements no matter what driver I use.

Wednesday, March 7, 2012

Call RS from

Hi,
I am creating an asp.net app and was wondering how I can call up a report
created in RS from my app?
Does anyone have any websites or docs on how to use RS?
Thanks,
JJTake a look at the ReportViewer sample code from Microsoft. It should land
in your install folder under Samples\Applications.
Cheers,
--
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"JJ" <JJ@.discussions.microsoft.com> wrote in message
news:AC6C1281-C687-41A0-A37D-11E1C2F7F71D@.microsoft.com...
> Hi,
> I am creating an asp.net app and was wondering how I can call up a report
> created in RS from my app?
> Does anyone have any websites or docs on how to use RS?
> Thanks,
> JJ|||You can find more info about RS here:
www.ReportingServicesFaq.com
And there is a RS Wiki community being built here:
www.ReportingServicesFaq.com/ow.asp
Jeff A. Stucker wrote:
> Take a look at the ReportViewer sample code from Microsoft. It should land
> in your install folder under Samples\Applications.
> Cheers,
>|||go thorugh this link a wonderful article on how to: reporting services
http://www.15seconds.com/issue/041013.htm
raj.
"RS Guy" wrote:
> You can find more info about RS here:
> www.ReportingServicesFaq.com
> And there is a RS Wiki community being built here:
> www.ReportingServicesFaq.com/ow.asp
>
> Jeff A. Stucker wrote:
> > Take a look at the ReportViewer sample code from Microsoft. It should land
> > in your install folder under Samples\Applications.
> >
> > Cheers,
> >
>