473,549 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored procedure not returning anything

24 New Member
Returns nothing?

private DataSet DoQuery()
{
DataSet ds = null;
SqlConnectionSt ringRG_Study = ConfigService.I nstance.GetStri ng("RG10_Study" );

try
{
VxDbClient _dbClient = new VxDbClient();
VxDbConnection _connection = new VxDbConnection( VxDbType.Sql, SqlConnectionSt ringRG_Study);
_dbClient.Conne ctionString = _connection.Con nectionString;

ds = _dbClient.Execu teStoredProc("R g_sp_GetReportL ist", null);

return ds;

}
catch (Exception ex)
{
throw ex;
}

}


set QUOTED_IDENTIFI ER ON
go

public DataSet ExecuteStoredPr oc (string spName, VxDbParameter [] Params)
{
DataSet ds = null ;
bool bWasOpen = true ;

if (_adapter != null)
_adapter.Dispos e() ;
_adapter = null ;
if (_cmd != null)
_cmd.Dispose() ;
_cmd = null ;

if (false == CheckSetConnect ion())
return (null) ;

try
{
_cmd = new VxDbCommand (spName, _connection) ;
_cmd.Transactio n = _transaction;
_cmd.CommandTim eout = CMD_TIMEOUT ;
_cmd.CommandTyp e = CommandType.Sto redProcedure ;

if (Params != null)
{
for (int i = 0 ; i < Params.Length ; i++)
{
_cmd.Parameters .Add (Params[i]) ;
}
}
if (_connection.St ate != ConnectionState .Open)
{
bWasOpen = false ;
_connection.Ope n() ;
}
_adapter = new VxDataAdapter (_cmd) ;
ds = new DataSet () ;
_adapter.Fill (ds) ;
if (false == bWasOpen)
{
_connection.Clo se() ;
bWasOpen = true ;
}
}
catch
{
if (ds != null)
ds.Dispose() ;
throw;
}
finally
{
if (false == bWasOpen)
_connection.Clo se() ;
if (_adapter != null)
{
_adapter.Dispos e() ;
}
}
return (ds) ;
}

this.bindingSou rce1.DataSource = DoQuery();
this.ultraGridD ashBoard.DataSo urce = bindingSource1;


ALTER PROCEDURE [dbo].[Rg_sp_GetReport List]

AS
BEGIN
SET NOCOUNT ON

SELECT ReportId, ReportName, ReportDefinitio n
from Report

END
Oct 16 '06 #1
1 1592
bharathreddy
111 New Member
Hai,

I think you are not setting the parameter type : Input/Output/InputOutput.

_cmd.Parameters .Add (Params[i]) ;

Here it is not showing any parameter type. By default it is Input. If u want the storedprocedure to return any value then that parameter type should be either Output or InputOutput.

Note : Input means which are input to the storedprocedure .
Output means which is output form the storedprocedure .
InputOutput means both it acts as input and output to sp.
Oct 17 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10881
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the cursor is defined as: SQL_CURSOR delpt_cursor
6
26520
by: Terentius Neo | last post by:
Is it possible to combine (in DB2 UDB 8.1) a stored procedure and a select statement? I mean something like this: Select c.number, call procedure( c.number ) as list from table c With best regards
2
11674
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry...
3
51727
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, Mike
1
1264
by: .Net Sports | last post by:
i have an aliased column in an sql statement that works fine when displaying its output in a datagrid, but when I transfer the sql statement into a stored procedure , the datagrid can't see it. I get an error "{"DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name myaliasedcolumn." }
4
4347
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier Architecture. The Stored Procedures are used through TableAdaptors, which in turn are used by Class Files. I wish to be able to return this new ID...
3
2201
by: satish mullapudi | last post by:
Hi, I am using DB2 v8.2 & jdk 1.5. I have written a Hello World program in java. Now is it possible to call the HelloWorld program from a stored procedure ? If so, how? I want to catch the result returned by the java program into the stored procedure. Please help out in this regard Thanks in advance........ Satish....
9
4130
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table. When calling the stored procedure from VB.NET, in the CommandText, can I just say "INSERT_INTO_MYTABLE '12345'" instead of calling it with...
7
5835
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored procedure from a PHP program, and run a stored procedure. I have yet to figure out the proper way to do this. My stored procedures work fine...
14
4573
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but nothing seems to work. What data type must I return for this to be accepted as .NET stored procedure?
0
7546
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6071
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3496
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.