DataSource Controls :: Multiple Resultsets Generated By Stored Procedure In Net?
Mar 18, 2010
suppose the stored procedure is like this
create procedure tttt
(@EMP_CODE VARCHAR(15)
)
AS
SELECT * FROM demand_month where(EMP_CODE=@EMP_CODE
SELECT * from demand_week where EMP_CODE=@EMP_CODE
go
How to display it in a gridview
View 14 Replies
Similar Messages:
Jun 12, 2010
Just after some advice I have a stored procedure that returns several tables. I then need to loop through the tables and create dynamic gridviews using the data. At the moment this stored proc is called using
[Code]....
I have used an xsd file to populate everthing else, but due to this returning multiple tables i wasn't sure how this works should it just be in its own xsd? as all the oather i just get a datatable where as with this i need a dataset... how this makes sense...
View 2 Replies
Jun 2, 2010
Is it possible to return multiple values from a stored procedure? Basically, if I execute the stored proc on the C# side, then on the SQL side I do multiple calculations. Let's say I have 5 int values I need returned to the C# side.
View 4 Replies
May 5, 2010
i want to return two output parameter n temp table from sql server stored procedure
View 6 Replies
Jun 2, 2010
basically i have two dropdown boxes to filter data and textbox with stored procedure bound to gridview.i want to be able to query data depending on the selected value passed,either using one or more parameter values.
i would like seperate sqlcommands to chose from depending on which controls i select to pass parameters.
i have included a parameter Select(control id) as this is declared by the wizard for stored procedure.
but i am not sure how it is defined on the page and passed to procedure.
[Code]....
View 2 Replies
Feb 4, 2010
Is it possible to add multiple select statements in a single stored procedure. The select statements are getting data from different tables. If yes, could anybody provide an example in adding multiple select statements, which retrieve data from different tables in a stored procedure.
View 3 Replies
Feb 3, 2011
I am using a sql stored procedure which returns multiple result sets. By default Sql Datasource is binding the first result set to gridview. I want the second result set to be binded. I browsed all the properties in Sql datasource but could not find one to set this.
View 4 Replies
Apr 2, 2010
This is surareddy. i nead some small clarification in the "Stored Procedure"
how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.
right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.
how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure
View 4 Replies
Dec 9, 2010
Initially, I have tried to use stored procedure. But I changed my mind and preferred to call sql query in codebase with command text. However, it stills tries to find initially-called stored procedure (which is neither called or exists).I think that it is related caching. But I tried it with different browsers it did not work.What might be the reason?
View 4 Replies
Jun 4, 2010
I am using 3 web controls ,two are cascading dropdownlists used to filter gridview control bound to a datasource.
My question is , How to define multiple queries in stored procedure that takes parameter values from the controls declared using sqldatasource.Also, return all data when i set default control value to say 'null'.
NB: one paramaterised query for cascading dropdownlists and another for other control.
View 8 Replies
Jan 18, 2010
Does anybody if it is possible that a stored procedure returns rows which is the result of the execution of another sp? Something like..
[Code]....
View 11 Replies
May 13, 2010
i want to return output parameter from 1 storeprocedure. into another stored procedure.
View 7 Replies
Nov 22, 2010
I have a dozen dropdowns and each one is bound to an SP. The page was taking much time to load as time times db is getting connected and sps are called.I thought of using a single sp returning multiple recordsets and iterate through each record set.
Ex:create procedure getdeptsemps
as
begin
select
*
from emp
select
*
from dept
end
I am able to iterate through both the result sets using NextResultset but all I need to know is, how I can assign the recordset into multiple entities like Emp and Dept ?I will assign these Emp and Dept into corresponding dropdown lists.
View 4 Replies
May 1, 2010
I want to apply other stored procedure select query on result of first stored procedure.
View 1 Replies
Apr 27, 2010
I am using Visual Studio 2008 and SQL Server 2008 and have added a SQL datasource to my form.
When I configure the datasource, I choose my connection string which looks like this in my webconfig:
<connectionStrings>
<add
name="PSFSPRD_ConnectionString"
connectionString="Data
The database I am using has a schema called EQB and as such, my stored procedures are named as EQB.usp_SelectFunds, EQB.usp_SelectAccount, etc.
On the select tab of the Configure Data Source screen, I choose to use a stored procedure. The dropdown shows my stored procedures, however, the schema name does not show up in front of the stored procedures in the drop down. I see only usp_SelectFunds, usp_SelectAccount, etc.
I select one of the stored procedures and when I click TEST, I get the message that the stored procedure is not found. If I instead choose to use a SQL statement instead on the configuration screen and enter EXEC EQB.usp_SelectFunds and click TEST, it works fine.
Why are my stored procedures not showing up correctly in the stored procedure drop down and how can I fix this?
View 3 Replies
May 30, 2010
how to use stored procedure in asp.net for for manipulation form sql server (in details).
View 2 Replies
Mar 31, 2010
parameters inside the stored procedure.How to write .
View 6 Replies
Jun 17, 2010
I created a database on SQL Server 2005 developer edition with MS SQL Server Mangement Studio Express. Now I created code that accessess a stored procedure named 'pS_TableData'. However I have one problem the code raises an exception "Could not find stored procedure 'pS_TableData 'Letters''."the code looks like this:
[Code]....
Note I am using (for now) the same connection that I used to create my database so in essence my web site is the administrator. I tried a simple SELECT from a table with the same connection and it raised no exceptions!When I run EXECUTE ps_TableData 'Letters' in SSMS it has no . I also tried EXECUTE ps_TableData 'Letters' as the command paramated for SqlCommand but it had the same effect
View 1 Replies
May 15, 2010
I call this stored procedure with a dataset. It always returns a 0 but should return a 1 or 2. Does anybody know why it isn't returning a 1 or 2.
ALTER PROCEDURE dbo.sp_InsertLinkVote
@LinkId int,
@LinkVoter nvarchar(50),
@LinkVotesDateTime datetime,
@LinkVotesGoodBad bit
AS
/* SET NOCOUNT ON */
If EXISTS
(SELECT
*
FROM
LinkVotes
WHERE
LinkId=@LinkId
and
LinkVoter = @LinkVoter )RETURN
1
ELSE
INSERT INTO
dbo.LinkVotes (LinkId,LinkVoter,LinkVotesDateTime,LinkVotesGoodBad)VALUES
(@LinkId,@LinkVoter,@LinkVotesDateTime,@LinkVotesGoodBad)RETURN
2
Here is were a call it in my code behind.
Dim VoteCheck
As
Integer
Dim InsertVote
As
New DataSetStoredProceduresTableAdapters.QueriesTableAdapter
VoteCheck = InsertVote.sp_InsertLinkVote(LinkId, User.Identity.Name, DateAndTime. Now,
True)
'0 is a good vote.
If VoteCheck = 0
Then
It seems to insert and not insert correctly, I just cannot get it to return the correct value.
View 4 Replies
Jun 23, 2010
I am developing a page in ASP.Net where I have the user enter a letter into a textbox. They then click a submit button and I all of the userids that start with that letter are to be displayed. So I need the SP to go through the database and match first letters with what was entered. Here is what I have as my code for the SP:
CREATE PROCEDURE dbo.exp2 @testchar Char(1)
declare @flag as char(2)
set @flag = @testchar + '%'
select userid
from ex_database
where userid like @flag
View 6 Replies
May 25, 2010
So I'm working with SQL Server 2005 and I'm having trouble saving a stored procedure. (I've only used an Apache server before, and for nothing as complex as the project I'm working on)
Nonetheless, the problem is that I don't know where to actually save the stored procedure I create. In my Object Explorer, I go to the database I want to create it in, expand Programmability, right click on Stored Procedures and choose to create a new one. That's all nice, but when I'm ready to save and test it from my webpage, it asks where to save it. This is probably dumb of me, but I don't know where to. I try to save it on the desktop and click/drag to the Stored Procedures folder in my database, but all that does is open it, not actually store it in the database. Maybe I'm getting the point of stored procedures wrong? Let me know what I should do to save it in the right place so I can access it.
View 8 Replies
Mar 18, 2010
I just want to make sure I used SCOPE_IDENTITY() correctly to get the newly made TestimonialID
[Code]....
Is this the proper way to use it?
View 4 Replies
Jan 15, 2010
I'm trying to create a stored procedure that does two things:1st - Insert a new record in the contactus table.2nd - Gets the last primary key value from table contactus.I've created the following Stored Procedure but this is giving me an error when being executed.
[Code]....
View 5 Replies
May 11, 2010
I have a button which the admin will click on every new acad year to update the student's study level.
I have written a SP to do this process, however, it was working fine. But I faced problem when I did testing.
This is my student update study level stored procedure:
UPDATE Student
SET acadLevel = (CASE WHEN acadLevel < '3' THEN convert(char,acadLevel + 1) ELSE convert(char,'G') end )
WHERE acadLevel between '1' and '4';
Error: Conversion failed when converting the varchar value 'G' to data type int.
View 5 Replies
Apr 19, 2010
I have one pretty stupid problem - datetime issue. I've made one stored procedure for making jobs
[Code]....
[Code]....
View 9 Replies