Calling The SP From ASP.NET Application

Feb 8, 2008

Hi All,
 
I have problem in calling the SP from ASP.NET application 
 @DefApp nvarchar(255)= '' ,@DefBusFunction nvarchar(255)= '' ,@DefImpact nvarchar(255) = '',AS Begin declare @sql nvarchar(4000)declare @whereClause nvarchar(4000)DECLARE     @return_value intdeclare @sqlWhere nvarchar(4000) select @sql = 'SELECT DefApp, DefBusFunction, DefImpact FROM Def LEFT JOIN ZFunction ON (def.DefApp = ZFunction.App) AND (Def.DefBusFunction = ZFunction.BusFunction)' if @DefImpact <> ''      Set @whereClause = ' where DefImpact '      SET @whereClause = @whereClause + ' = ''' + @DefImpact + '''' set @sqlWhere=@sql + @WhereClauseEXEC @sqlWhereEnd 
and i am calling this SP from my ASP.net application to fill the SSRS report. I have written code in ASP.NET like:

 sqlCmd = new SqlCommand("subbusample", conn);

sqlCmd.CommandType = CommandType.StoredProcedure;sqlCmd.Parameters.Add(new SqlParameter("@DefImpact", SqlDbType.NVarChar, 255, txtValue3.Text.ToString()));

sqlCmd.Parameters.Add(new SqlParameter("@DefBusFunction", SqlDbType.NVarChar, 255, txtValue1.Text.ToString()));

sqlCmd.Parameters.Add(new SqlParameter("@DefApp", SqlDbType.NVarChar, 255, txtValue2.Text.ToString()));

 RptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;

RptViewer.ServerReport.ReportServerUrl = new System.Uri("http://servername/ReportServer");RptViewer.ShowParameterPrompts = false;

RptViewer.ServerReport.ReportPath = "/folder name/Subbu_Sample";
 
when i execute it, i am not able to fill the report with data.
 
Please let me know what i am doing wrong.
 
Thanks,
SR.

View 6 Replies


ADVERTISEMENT

Calling One Application From SQL Server

Mar 30, 2004

Is it possble to automatically call an application when another application makes an INSERT from inside sql server? If its possible - how do I do that?

Thx in advance

/MiZza

View 2 Replies View Related

Calling Stored Procedure From A C Application

Jul 20, 2005

I have an ODBC/C program and I want to call the stored proceduressp_addlogin and sp_adduser in it. Can someone please provide me withsome sample code showing the best way to do this.

View 2 Replies View Related

Calling A SSIS-Package From A COM+-Application

Oct 3, 2007

Hello

I have a SSIS-Package stored in the SQL Server. This package works fine when i execute it from the SQL Server. But if I try to execute the package from a COM+-Application, nothing happens.


Here is my code snipped:

Public Function ExecutePackage €¦
Dim myPackage As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult


'----- Execute the package from SQL Server
myPackage = app.LoadFromSqlServer("\PackageName", "ServerInstance", Nothing, Nothing, Nothing)
pkgResults = myPackage.Execute()
€¦

End Function

In a Windows Forms Application I can execute the package with this code snipped succesfully. Therefor I think that the problem is my COM+-Application.

Can anybody help me?


Thank's

Jürgen Paulus

View 4 Replies View Related

SSIS Calling An External Application

Apr 3, 2008

Can you put is a call withing a Data Flow that will call an External Application and pass a parameter to that application IE say a command line app and then take the output and assign it to back to the flow as a "column" or whatever for that row... IE I want to take a value push it to an external app and then the output from that app I want to insert it into another field for that row in the new table I am moving the data to.

View 4 Replies View Related

Return A Value From Stored Procedure To Calling Application

Jul 20, 2005

Hi,In SQL Books Online in the section on @@Error it gives the followingexample:-- Execute the INSERT statement.INSERT INTO authors(au_id, au_lname, au_fname, phone, address,city, state, zip, contract) values(@au_id,@au_lname,@au_fname,@phone,@address,@city,@state,@zip,@contract)-- Test the error value.IF @@ERROR <> 0BEGIN-- Return 99 to the calling program to indicate failure.PRINT "An error occurred loading the new author information"RETURN(99)ENDELSEBEGIN-- Return 0 to the calling program to indicate success.PRINT "The new author information has been loaded"RETURN(0)ENDGOHow do I access the value returned by the RETURN statement (i.e. 99 or0) in my asp application that called the stored proc.Sometimes rather than just return an integer signifying success orfailure I've seen examples where the id of the newly added item isreturned on success and perhaps -1 if the operation fails. Theseexamples make use of ouput parameters to achieve this. If theoperation succeeds then then the output parameters value is set to thenew id and this is accessed from the calling application.E.g.IF @@ERROR <> 0BEGIN-- Return -1 to the calling program to indicate failure.PRINT "An error occurred loading the new author information"SELECT @MyOuptputParameter = -1ENDELSEBEGIN-- Return id to the calling program to indicate success.PRINT "The new author information has been loaded"SELECT @MyOuptputParameter = @@IDENTITYENDWhy go to this trouble if you can use the RETURN statement?

View 4 Replies View Related

Pass Scope_Identity() Back To The Calling Application

Jul 20, 2005

I'm using an Access2K front end on a SQL Server2K backend.I use Scope_Identity() in a lot of stored procedures to pass thenewwly inserted record's unique ID to the next select statement in thesame stored procedure.What I'm wondering is how I can pass the Scope_Identity back to thecalling application.I'm hoping someone can show me the SP code and the aceess code neededto accomplish the following:I insert a new record in a table with a stored procedure. The SPpasses the uniqueID (Scope_Identity) back to MS Access, then MS Accessuses the uniqueID when calling another function...thanks

View 1 Replies View Related

Application Crashes When Calling To Sql Server Routine

Mar 19, 2008

I have an application that manage an sql srever compact edition database it worked OK until I got the following problem:
Only when debuging the application ("Start Debugging" from visual studio). In the first call to an sql server routine I get an exception "Unspecified error [ sqlceqp30.dll ]"

My code:

this.usersTableAdapter.Fill(this.nessDBDataSet.Users);

The line with the exception:


[global:ystem.Diagnostics.DebuggerNonUserCodeAttribute()]

[global:ystem.ComponentModel.DataObjectMethodAttribute(global:ystem.ComponentModel.DataObjectMethodType.Fill, true)]

public virtual int Fill(NessDBDataSet.UsersDataTable dataTable) {

this.Adapter.SelectCommand = this.CommandCollection[0];

if ((this.ClearBeforeFill == true)) {

dataTable.Clear();

}

int returnValue = this.Adapter.Fill(dataTable); //Here I get the exception

return returnValue;

}

The Exception:

Unspecified error [ sqlceqp30.dll ]

Again if I do "Run Without Debugging" Evrything is working.

Can any one help me with this

Thanks
Ofer

View 2 Replies View Related

401 Unauthorized Access When Calling Report Server From ASP.NET Application

Feb 11, 2008

I receive the following error when i call report server web service from an asp.net application:

"The request failed with HTTP status 401: Unauthorized."



Here are the IIS logs on the reporting services server. When i open IE and browse to the web service i provide my user credentials and i can access the web service just fine. However when i call the web service via my asp.net application it looks like my credentials are not being passed??

Browsing web services via internet explorer.

2008-02-11 21:26:13 W3SVC1836052065 HQSQLDEV1 10.69.21.140 GET /Reports/images/16fold.gif - 8080 triwestdbloom 10.69.21.140 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+WOW64;+SV1;+.NET+CLR+2.0.50727;+.NET+CLR+1.1.4322) 10.69.21.140:8080 200 0 0 15

Call from ASP.NET App

2008-02-11 21:26:13 W3SVC1836052065 HQSQLDEV1 10.69.21.140 GET /Reports/images/16fold.gif - 8080 - 10.69.21.140 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+WOW64;+SV1;+.NET+CLR+2.0.50727;+.NET+CLR+1.1.4322) 10.69.21.140:8080 401 1 0 0

Here is my code:


RSWebService.ReportingService rs = new RSWebService.ReportingService();

rs.Credentials = new System.Net.NetworkCredential(@"triwestdbloom",

"blah", "triwest");



//rs.PreAuthenticate = true;

//Get all folders

RSWebService.CatalogItem[] allItems = rs.ListChildren("/", false);

//Get only folders not hidden to the user.

List<RSWebService.CatalogItem> visibleItems = new List<RSWebService.CatalogItem>();

foreach (RSWebService.CatalogItem item in allItems)

{

Response.Write(item.Name.ToString());

}

Any ideas?

View 2 Replies View Related

Application Crashes When Calling Sql Server Routine In Debug Mode.

Mar 23, 2008

I use Microsof Visual Studio 2005 to write a c# aplication for my compact device (Dell Axim).
I also use Sql Server Compact Edition to handle my database.
Everything worked OK but suddenly I get an exception on the first call to fill command of a table in my database (Any table) This exception is happenning only when I debug the application if i run the application without debug everything is workink OK.
The exception details are :

System.Data.SqlServerCe.SqlCeException was unhandled
Message="Unspecified error [ sqlceqp30.dll ]"
HResult=-2147467259
NativeError=25123
Source="SQL Server Compact Edition ADO.NET Data Provider"
StackTrace:
at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen()
at System.Data.Common.DbDataAdapter.FillInternal()
at System.Data.Common.DbDataAdapter.Fill()
at System.Data.Common.DbDataAdapter.Fill()
at Ness300.NessDBDataSetTableAdapters.UsersTableAdapter.Fill()
at Ness300.LoginPanel.DoLogin()
at Ness300.LoginPanel.OKButton_Click()
at NL300Controls.BmpButton.L300Button_MouseUp()
at System.Windows.Forms.Control.OnMouseUp()
at System.Windows.Forms.Control.WnProc()
at System.Windows.Forms.ContainerControl.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at Ness300.Program.Main()

I tried to run the application from the mobile device in order to connect to it doing "Attch to running process" from visual studio.
But just running the application on the device with the resgistry value:
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETCompactFrameworkManaged DebuggerAttachEnabled
set to 1 caused the crash when I set it back to 0 everything works fine.
It worked for me before I do not know what happened.
Is it a security problem ?

Can any one helpi me with this because this problem do not give me a way to debug my application.

View 3 Replies View Related

Using ReportViewer Controls In A Jsp Application Calling Reporting Services Using Web Services

May 29, 2007

Hi,



I am invoking RS web services to render reports, using Apache Axis to generate stub classes from Reporting Service WSDL.



Please let me know if I can integrate Report Viewer control in the jsp where I am writing the report output. Else do I have to create my own custom tags simulating ReportViewer functionality.

View 4 Replies View Related

Distrib.exe Application Error , Application Failed To Initialize Properly(0xx0000142)

Apr 13, 2008

have SQL Server 2005 std edition SP1 installed on Windows 2003 Std edition .Configured Transactional (single Publisher and no clustered environment.)
Replication past two months working fine, Now
1.Distrib.exe application err is coming.

Due to which my job is failing (Distributor to Subscriber).
Iam attaching thw file.
Thanks
Sandeep

View 1 Replies View Related

What I Need To Run Compiled Application On Another Application?

Sep 11, 2007



Hey,
don't know if it's the right place for this question but i hope you help me.
I made an application with VS 2005 that connecting to sql server file db.mdf
Now i want this application work on another user computer, and of course i don't want to install vs 2005 there.
I did install .net framework, but what i need to do to make the database work? do i have to install sql server on his computer? or is there something more simple?
I know that if i was using access file than i need to install nothing else.
please help!
thanx.
max

View 4 Replies View Related

Calling DTS From C#

Oct 25, 2006

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 object
System.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 columnFunction 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_OKEnd Functionthe 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

View 1 Replies View Related

Calling A SP

Jan 6, 2008

Hello,
I have done extensive work with Classic ASP for 9 years now. Working with Stored Proceedures etc
However now am working in c# am adviced by a friend that its best to use the
1. The "Object data source" to call SP
2. Are there any documentations pointers on best practices, how its done ?
I want to use the "on click event" in my class file.
thanks
Ehi

View 3 Replies View Related

Calling A SP In .net

Jan 9, 2008

Hello,
are there any sample codes that show you how to execute a SP in .net
1. Using a class
2. Calling the class in the onlick_button function ?
thanks
Ehi

View 1 Replies View Related

Calling SP From SP

Jan 20, 2004

I'm developing a new Stored Proc that will be taking information in to enter customer and order info. Looking at the current Stored Proc its using alot of If statements and I'm thinking of breaking the sp up into different Stored Procs and calling them all from One main stored proc. I know how to do this but I was wondering how it would effect performance. So should I simply keep all the stuff in one proc or module it out into multiple ones to make it easier to follow and read?

Thanks

View 1 Replies View Related

Example Of A Sp_ Calling Another Sp_.

Sep 18, 1998

Does anyone have an example of a Stored Procedure calling
another stored procedure and passing it parms.

What I would like to do is: Have a stored procedure select
data from a table and pass that data to another stored
procedure.


Thanks in advance,

Rodney

View 3 Replies View Related

Calling SP

Sep 14, 2007

Hi,
Can I call SP in the Trigger? Googled for this but din gt any satisfactory answer.




Thnkx,
Rahul Jha

View 13 Replies View Related

Calling One SP From Another SP

Mar 26, 2008

I'm working in SQL Server 2005. I have an existing SP that does exactly what I need (it's the aspnet_UsersInRoles_IsUserInRole SP). I want to reuse this SP and use it's return value as a field in the SP I'm writing. How do I go about doing this? I could take the logic out of the called SP and wrap it in a function; but, I would really like to reuse the SP aspnet_UsersInRoles_IsUserInRole. Thanks in advance for any assistance.

View 7 Replies View Related

Calling A Dts Package From VB.NET

Jan 8, 2007

hi,
i'm trying to call a dts package from vb.net.
i got 2 examples which both don't work.
first one gives me a [DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied error.
source code:Dim serverName As String = "SERVERNAME"Dim oPackage As New DTS.Package()Dim oStep As DTS.StepDim pVarPersistStgOfHost As Object = Nothing
oPackage.LoadFromSQLServer(serverName, "USERID", "PASSWORD",     DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _  "DTSPASSWORD", Nothing, Nothing, "DTSPACKAGENAME", pVarPersistStgOfHost)
For Each oStep In oPackage.Steps      oStep.ExecuteInMainThread = TrueNext
oPackage.Execute()
Dim err As LongDim source, description, message As StringFor Each oStep In oPackage.StepsIf oStep.ExecutionResult = DTSStepExecResult.DTSStepExecResult_Failure Then        oStep.GetExecutionErrorInfo(err, source, description)        message = String.Format("ErrorCode: {0}, Source: {1}, Description: {2}", err.ToString(), source,                              description)Else         message = "Success"End IfNext
oPackage.UnInitialize()oPackage = Nothing
second example tries to create a dts package dynamically. this time i get the error that the CustomTask can not be casted, somehting about the QueryInterface.
source code:Dim oPackage As New Package2()Dim oConnection As Connection2Dim oStep As Step2Dim oTask As TaskDim oCustomTask As BulkInsertTask
oConnection = oPackage.Connections.[New]("SQLOLEDB")oStep = oPackage.Steps.[New]()oTask = oPackage.Tasks.[New]("DTSBulkInsertTask")oCustomTask = CType(oTask.CustomTask, BulkInsertTask) <-- error
With oConnection       .Catalog = "CATALOG"       .DataSource = "SERVERNAME"       .ID = 1       .UseTrustedConnection = True       .UserID = "USERID"       .Password = "PASSWORD"End With
oPackage.Connections.Add(oConnection)oConnection = Nothing
With oStep        .Name = "InsertGemal"        .ExecuteInMainThread = TrueEnd With
With oCustomTask        .Name = "InsertGemal"        .DataFile = "D:ImportGemal.dat"        .ConnectionID = 1        .DestinationTableName = "Gemal"        .FieldTerminator = ";"        .RowTerminator = "
"End With
oStep.TaskName = oCustomTask.Name
With oPackage        .Steps.Add(oStep)        .Tasks.Add(oTask)        .FailOnError = TrueEnd With
oPackage.Execute()
oPackage.UnInitialize()oPackage = Nothing
any help highly appreciated!
t.i.a.,ratjetoes.

View 3 Replies View Related

Calling SQL Function In C#

Feb 22, 2007

Hello,
I am trying to call a SQL Function in C#, as I want to get the value binded back to the column in a datagrid.
 
Any answers will be appreciated ...............Urgent.
 
:)

View 4 Replies View Related

Calling A SP In A Class

Jan 17, 2008

Hello,
I have the class below. And trying to execute it on a button click event.
What am i doing wrong ?
Thanks
Here is the button click event1 protected void Button1_Click(object sender, EventArgs e)
2 {
3 signup_data_entry signup = new signup_data_entry();
4 signup.signup_data_entry();
5
6 }

  
Here is my class file. please advice
 1 public class signup_data_entry
2 {
3 public signup_data_entry()
4 {
5 //SqlConnection con = new SqlConnection("cellulant_ConnectionString");
6 SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cellulant_ConnectionString"]);
7
8 SqlCommand command = new SqlCommand("Cellulant_Users_registration", con);
9 command.CommandType = CommandType.StoredProcedure;
10
11 con.Open();
12
13 //string IP = new string();
14
15
16 command.Parameters.Add(new SqlParameter("@RegionID", SqlDbType.Int, 0, "RegionID"));
17 command.Parameters.Add(new SqlParameter("@RegionDescription", SqlDbType.NChar, 50, "RegionDescription"));
18
19 command.Parameters[0].Value = 4;
20 command.Parameters[1].Value = "SouthEast";
21
22 int i = command.ExecuteNonQuery();
23
24
25 }
26 }

 

View 6 Replies View Related

Calling Asynchronously

Mar 7, 2008

In my shared hosting environment where I am making large volumes of database calls, I am very anxious to preserve my heavily throttled threads-I presume when I make a database call, that it is going to a separate server and any threads that server may be using are in addition to my " hosting plan ".
My question (s) is, is it therefore a no-brainer to always make calls to:Dim oResult As IAsyncResult = iDBCmd.BeginExecuteReader()arWaitHandles(0) = oResult.AsyncWaitHandleiIndex = WaitHandle.WaitAny(arWaitHandles, 60000, False)
i.e. run all calls to the database asynchronously?
Is it really releasing a thread back to my asp.net App while it is waiting? (I.e. Is it worth doing)
 

View 4 Replies View Related

Help Calling DTS Package.

Aug 18, 2004

I'm new to using DTS packages and I'm running into a problem. Hopefully someone can help me out. I have an ASP.NET page that needs to call a DTS package. Everything seems to be working right up until I call opkg.Execute. The package seems to run but nothing happens. After further investigation I have found what looks like a permissions issue. this is the message I'm getting"
Error Number:
-2147467259 {Integer}

Error Description:
"The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data." {String}

This is obviously a permissions issue. I'm just not sure who the DTS package is running as and where to set the permissions.

Any ideas????

Thanks

View 1 Replies View Related

Calling A DTS Package From An Sp

Aug 31, 2001

How to do this?thanks :-)

View 1 Replies View Related

Calling A Dts Package From VB

Sep 15, 2000

Does anyone know the command that can be used to call a dts package directly from VB?

regards,
reshma

View 1 Replies View Related

Calling SP With Parameters

Jun 3, 2000

Hello,

What is the syntax of calling stored procedure from vb

Is there any1 can please give me a example of how to call sp with passing parameters, thanks a lot.




Thanks

View 1 Replies View Related

Calling DTS Package

May 27, 2004

I have a DTS package created in a databasse and need to call that DTS package from a stored procedure.Is there a way that I can do it?

View 2 Replies View Related

Rollback Of Sp Calling Another Sp

Mar 10, 2006

If you have a begin tran in a sp that calls another sp and that called sp fails. can you execute a roll back from the called sp, or should it return and error which will roll back the begin tran in the original sp

View 1 Replies View Related

Calling A DTS Package From VB

Mar 22, 2002

Hi all,
I want to call dts package from visual basic. The dts package will do a backup of the database.
I am not sure how this can be achieved.
Any help will be great
Thanks

View 1 Replies View Related

Calling All GURUS ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

May 19, 2002

SQL Server Load Balancing -- Any ideas?

There is no inherent mechanism available in SQL Server (replication, log shipping, or clustering) which allows you to load balance you database server.
Clustering is only useful for a failover situation and does not allow active/active balancing.

Is is possible to use merge replication between two identical OLTP servers
and manage transactions via MSMQ? Will this mechanism allow for a load balanced OLTP server?

Will this work? If not, why not?
What will work? Will federated servers work for an entire database??

View 1 Replies View Related

Calling Dll`s/exe`s From SQL Server

Oct 5, 1998

I need a simple example of calling a dll or exe with params
from a stored procedure.

Thanks
Robert Kapciuk

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved