DataSource Controls :: Build Output Based On Data

May 24, 2010

This is my Table Structure....

OrderNo Itemcode Name AQty BQty

AB1 001 A 50 60
AB1 002 B 50 50
AB1 003 C 50 40
AB1 004 D 100 120
AB1 005 E 100 100
AB1 006 F 100 80
AB2 007 B 100 95

I need The first resultset/Output like This....

OrderNo Itemcode Name AQty BQty Total

AB1 001 A 50 60 -10
AB1 004 D 100 120 -20

I need The Second resultset/Output like This....

OrderNo Itemcode Name AQty BQty Total
AB1 003 C 50 40 10
AB1 006 F 100 80 20
AB2 007 B 100 95 05

I dont need To show 002,005 coz itz Total is zero(0). Herr i need to show Record Based on OrderNo...

View 4 Replies


Similar Messages:

Forms Data Controls :: Easiest Way To Build XML Based Menu With Submenu

Sep 2, 2010

I need to develop an easy and quickly to build menu structure based on xml. The menu needs to have a "Main" menu at top of the screen and a submenu at the left of the screen. Excactly like this: [URL] where i need to get started and wich control i should use?

View 1 Replies

Build A Data Access Layer For New Web Based Application?

May 17, 2010

I was looking to build a Data Access Layer for my new web based application, I'm using ASP.NET. I'm want to build a framework not only for this application but also want to utilize it for my future projects.

Actually my main aim is to make a framework, from DAC, DAL, BL to GUI. I want suggestions from you guys that what should i adopt, what give me flexibility, which suits for both small and large size applications.

View 4 Replies

Forms Data Controls :: Repeater Won't Use DataSource - No Errors But Build Still Fails?

Jul 22, 2010

I figured I'd post here while I'm scouring the internet for a solution to my problem.

This code works:

[Code]....

My DataAccess method just uses the SQL statement and returns a dataset. If I comment out the repeater DataSource and DataBind lines, it will build successfully. And I know the dataTable has the information I want because I was able to step through and see it. If I leave in the DataSource and DataBind lines, I'm not even able to step through. I have no errors and no warnings, just build failed.

*EDIT* I apologize for the ugliness of this post, I don't know what happened. I changed the repeater to a DataGrid, and still got the Build Error without any errors. I went on anyway, came back, and now everything works fine. A little bug must've crawled in while I wasn't looking.

View 2 Replies

Custom DataSource Extender - Where To Grab The Output Data Of The DataSource

Jun 9, 2010

I dream of creating a control which works something like this:

<asp:SqlDataSource
id="dsFoo"
runat="server"
ConnectionString="<%$ ConnectionStrings:conn %>"
SelectCommandType="StoredProcedure"
SelectCommand="cmd_foo">
</asp:SqlDataSource>
<Custom:DataViewSource
id="dvFoo"
runat="server"
rowfilter="colid > 10"
datasourceid="dsFoo">
</Custom:DataViewSource>

I can accomplish the same thing in the code behind by executing cmd_foo, loading the results into a DataTable, then loading them into a DataView with a RowFilter. The goal would be to have multiple DataViews for one DataSource with whatever special filters I wish to apply to the select portion of the DataSource. I could imagine extending this to be more powerful. I tried peaking at this and this but am a bit confused on a few points. Currently, my main issue is being unsure where to grab the output data of the DataSource so I can stick it into a DataTable.

View 1 Replies

DataSource Controls :: Retrieve Data Based On Years?

Jul 8, 2010

I need to retrieve data based on 3 different selections(current year, 5 years, 10 years). If the user select current year, then I need to pull data with the most up to date year, if the user selects 5 years, then I need to pull data for 5 years from the most up to date year in database. I am trying to accomplish this in sql due to using object DataTables in asp.net 3.5. I am able to do this with separate queries but I need to accomplish this with one query. I was going to use CASE statements but not really sure if I am approaching this correctly.

View 9 Replies

DataSource Controls :: GridView To Display The Data Based On One Or The Other?

Apr 5, 2010

I have a web form with two drop downs.I want the gridView to display the data based on one or the other.The user can then select a record to be displayed in a detail view.This method works as long as I am only viewing the data.If the user edits the data in the detail View and then updates the detail view when the page reloads the grid goes blank.I have traced the code and there is data in the query after the update but the select statement for the LinqDataSource is overriding the code in the lqGrid_Selecting.I can make the above scenario work using SqlDataSources,but I thought LinqDataSources were the way of the future.

[code]...

View 1 Replies

DataSource Controls :: How To Get SP Output Parameter From ODS

Aug 4, 2010

I have a stored procedure with output parameter. I encapsulate it with Table Adapter and BLL. Call it using ObjectDataSource in conjuction with formview, just like the one in Data Access Tutorial. How do I get the output parameter in event INSERTED of the ObjectDataSource in code behind (VB)?

My stored procedure looks like this:

[Code]....

My BLL code looks like this:

[Code]....

View 2 Replies

DataSource Controls :: Output Parameter Not Getting Value?

Jul 12, 2010

We have a stored procedure which creates and returns as output the next value in line:

[Code]....

Yes, the dullards who created this system not only failed to use an identity for the primary key of this table, they then proceeded to add 1 to a varchar column to create the new value, thus insuring it can never be anything but numeric.

Sigh. I'm told we cannot address that obvious deficiency now, and we have to leave the column as varchar. Double sigh.

If I execute this sproc from SSMS, the hh_num variable is returned as expected:

[Code]....

However, when I run it through the application, the parameter I set up as output does not get its Value attribute changed:

[Code]....

I've verified that the "@hh_num" maintains its direction and name through the ExecuteNonQuery call, but its Value remains an empty string.

View 1 Replies

DataSource Controls :: Retrieve Data From SQL Server Based On Login Username (session Data)

Oct 12, 2010

I'm trying to make a dropdown list with data available based on the users login name. Heres what I have as my SQL Query in the SQLDataSource:

SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')

So say if the login username is "User1" but the database client name is "User1 Steel" I want the dropdownlist to pull "User1 Steel" as the display and Client_ID as the value from the dropdown list.

View 1 Replies

DataSource Controls :: Retrieve Data From Data Base And Display A Field Based On The Dropdown?

Jul 6, 2010

I am in need to retrieve data from data base and display a field based on the drop down is selected

View 2 Replies

DataSource Controls :: Selecting All Data From A Table Based On Some Given Conditions?

Jul 8, 2010

I am having a staff table which contain staff information on it. To search staff information from the table, I want to prefer filter style. For example in the select query I want to display staff information according to three criterias. Select staff information from all sections, Select staff information from a given section, select staff information by a given Name. All these selects must be performed in a single select statement. Suppose,

SELECT * FROM StaffDetailsTbl
WHERE SectionID = CASE WHEN @SectionFilter IS NULL THEN [SELECT ALL]
ELSE SectionID = @SectionFilter
and Name = CASE WHEN @NameFilter IS NULL THEN [SELECT ALL]
ELSE Name Like '%@NameFilter%'

Where Declared variables are parameterized stored procedure values retrieved from the user.

View 2 Replies

DataSource Controls :: Filtering Data Based On Multiple Tables?

Mar 16, 2010

I am writting a directory website that advertises fitness classes. These classes are listed by Class Type, and Geographical Area. Each Class Type can satisfy one or more of four Fitness Goals such as Loose Weight etc...

I have a table for Classes (classid, classname, classdesc, classtypeid, geoareaid) I have a table for geographic areas (geoareaid, geoarea) And I have a table for ClassTypes (classtypeid, classtypename, classtypedesc)

Which obviously links geographic area via the classes.geoareaid as a forgien key and classtypes by classes.classtypeid as a forgien key.

I can list all classes by type and also by geo area no problem, the problem arrises when I then also want to filter by goal.

The Goals Table (goalid, goal, goaldesc) is linked to the classtypes table via another table classtypes_goals (classtypeid, goalid) as each classtype can satisfy any of the 4 goals.

I am using a DataSet to fetch the data from a Stored Procedure in the SQL Database but because the classtypes can be linked to multiple goals I am getting duplication in my list depending on how many goals a classtype satisfies.

All I need in my data list is class name, class type and area I don't even need to display the goal I just want a drop down above the table that will filter the list and show only classes of classtype that satisfy the goal chosen.

View 18 Replies

DataSource Controls :: How To Capture SQL OUTPUT Parameter

Oct 11, 2010

m trying to capture an output parameter from an SQL insert.for

CREATE TABLE [dbo].[Test](
[TestID] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
[Test1] [int] NULL,
CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED
INSERT INTO [Test] ([Test1]) OUTPUT inserted.TestID as TestOut VALUES 1))
[code]....

View 3 Replies

DataSource Controls :: Output Parameter Always Returns 0?

Apr 15, 2010

I have a gridview that has the header row modified in order to add new records; the gridview is bound to a sqldatasource control. In my code behind, i handle the insert in the following manner:

[Code]....

I know the insert is occuring because the new record shows up in the grid after the databind, but the output parameter is not picking up the scope_identity() value...what am i doing wrong with the output parameter?

View 2 Replies

DataSource Controls :: Way To Get Numeric Value In Stored Procedure As Output

Jun 4, 2010

i hav declare a Variable in stored procedure as@Total numeric(18,2) output..@Total Value is calculated 177.12 in stored procedure but when i return in Class.cs..its output is 177..

View 4 Replies

DataSource Controls :: How To Get Store Procedure Output Into Table

May 19, 2010

I want to execute a Store Procedure and then get the Output in one table. However I am not getting the query. I want something like this execute 'Stored procedure name' 'param1','param2','param3' and then get the result into some table. Is this possible?
select * into #table from (execute 'Stored procedure name' 'param1','param2','param3')

View 1 Replies

DataSource Controls :: How To Left Justify And Pad My Output On Select

Jul 7, 2010

I am reading a column value from the database. The field is defined as 30 charswide. If the vale read is less than 30 chars, I need to pad it on the right side withblanks. So that the value when written to a text file will appear to be left justified.How can this be done? I know how to right justify like below. But how do I left justifyand pad on the right side with blanks?Right(LTRIM(RTRIM(CustomerNum) + SPACE(30)),30) As CustNum -- This right justifies.This will NOT left justify so I am stuck :LEFT(SPACE(30) + LTRIM(RTRIM(CustomerNum)),30) As CustNum -- This WIL NOT justify as I wish

View 2 Replies

DataSource Controls :: How To Get Sql Query Output In Text File

May 31, 2010

how to get sql query output in text file?

View 1 Replies

DataSource Controls :: SqlDataSource Get Output Parameter And Assign To A Var

May 22, 2010

[Code]....

How do I get the "NewID" parameter value form the above datasource and assign it to a select parameter in a different sqldatasource?

View 2 Replies

DataSource Controls :: Cannot Acces Output Parameter From Datalayer?

Dec 1, 2010

in order to allow my design to keep recently inserted record on a formview i decided to use an output parameter.Currently I have a data layer helper and a class that allows my table to have crud operations.
I have modified my insert stored procedure to the following:


ALTER PROCEDURE [dbo].[InsertContratos]
(
@Contrato int,
@Persona int,
@FechaLegalizacion datetime,
@Vendedor smallint,
@Programa smallint,
[code]...

View 3 Replies

DataSource Controls :: Grab The Value Coming From The Output Parameter?

Mar 2, 2010

My stored procedure requires an input parameter -- @CompanyName -- and has one output parameter - @CompanyID. This is how I always handled stored procedures that did NOT use output parameters. How do I grab the value coming from the output parameter?

[Code]....

View 14 Replies

DataSource Controls :: Get The Output Parameter From Stored Procedure?

May 6, 2010

I have stored procedure that increments a number. I am supposed to use the newly generated number and insert it into a table. My question is how do I execute the stored procedure, with a hardcoded value of 3 that it expects as a paramter, receive the number it generates as the output parameter and use it in the insert statement.

Here is the stored procedure code:

CREATE PROCEDURE [dbo].[Generate]
@myid int,
@next_no int output
AS
update mytable
set mynumber=mynumber + 1, @next_no = number
where myid=@myid
RETURN

Here is my insert statement, that I tried and it failed:

EXEC @GetNo = Generate '3'
Insert into customers (custid, name, phone ) values
( @GetNo, 'MSFT', '800-345-5678')

View 5 Replies

DataSource Controls :: Output Parameter Not Working To Sqldatasource?

Aug 10, 2010

I am trying to get the uniqueidentifier value from a insert SP and retreive that using a sqldatasource and pass that value to store files in the relevent folder.

the SQL stored procedure

ALTER PROCEDURE [dbo].[sp_InsertIPRT]
@Site nchar(10),
@Description nvarchar(MAX),
@Application nvarchar(MAX),
@Coordinator nchar(50),
@ProjectNumber nchar(50),
@Manager nchar(50),
@DateRequested date,
@DateRequired date,
@Issues nvarchar(MAX),........

View 2 Replies

Forms Data Controls :: GridView,calculate Value Based On Other Columns& Save To Datasource?

Nov 8, 2010

I had just started with Visual Studio 2008 + VB.net. I've now designed my tables, and basic gridview functions properly.Now I'm faced with the problem of having to calculate a value based on 2 - 3 columns/data in the gridview, display the result in an existing column in the same gridview, and saving the calculated value in the datasource.I had initially created the "Total" column as a textbox displaying a manually calculated amount that is saved in the datasource. Now, I want to change the field to auto-calculate based on 2 other columns.

View 4 Replies







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