C# - Select DataTable (only Some Values) From _GetDisplayData And GROUP Data By Days Where Group Rules Is Different For Different Columns

Mar 4, 2010

Stack-Overflow :3 I've got a kind of hard-case question.

So I'll try clearly explain my idea with my poor english :/ need select to DataTable SOME values from ???_**GetDisplayData **procedure for each day of previos month (GROUP IT) where group rules for different columns is different


I need to select some values in stored procedure from other stored procedure like this :

SELECT X FROM Y_Procedure(@ProcedureParameters)Also I need to select from dynamic SQL Procedure like

Y_Procedure=@Y+'_Procedure'
SELECT X FROM Y_Procedure(@ProcedureParameters)


Also I need to load it to DataTable :-/INSERT INTO @Report (CellHorizontal, CellVertical, CellValue) --to TABLE
SELECT Date,X2,X3 FROM Y_GetDisplayData(@Param)

SET NOCOUNT OFF;
SELECT *
FROM @Report

GetDisplayData works as select with parameters and that doesn't returns SQL DataTable
And there is no way to recode GetDisplayData's procedures, it's just constant procedures for me.Finally I need to Group nodes from this table

INSERT INTO @Report (CellHorizontal, CellVertical, CellValue)
SELECT T1.Date,
IF ((Select grouptype...)=1) T1.X2 + T2.X2
ELSE IF ((Select grouptype...)=2) AVG(T1.X2,T2.X2),
IF ((Select grouptype...)=1) T1.X3 + T2.X3
ELSE IF ((Select grouptype...)=2) AVG(T1.X3,T2.X3),
(SELECT T2.Date,X2,X3 FROM Y_GetDisplayData(@Param) T2
WHERE T2.Date>T1.Date AND T2.Date>=T1.Date)
FROM Y_GetDisplayData(@Param) T1
GROUP BY EVERY DAY ???--and here is epic fail


I can make all stuff on asp server :And C# allows me to use something like SelectCommand = IzmProc + "_GetDisplayData"; And then I will work (select special data) with DataTables on ASP.NET Server but it's better to make all on SQL ... But looking like it's just unrealizable on SQL >_<

I gonna think about C# realization,but my code is very weird , got errors and doesn't works >_<

public static DataTable GetReport(string Param)
{
System.Configuration.ConnectionStringSettings connSetting = ConfigurationManager.ConnectionStrings["FlowServerConnectionString"]; [code].....

View 3 Replies


Similar Messages:

How Group By And Sum Values In DataTable

Jun 19, 2010

How group by and sum values in DataTable??I have a DataTable that looks like this:Id Value1 4.01 5.03 1.02 2.03 3.0I want to end up with (probably a new DataTable) that contains the sum ofvalues grouped by Id like this:Id SumOfValue1 9.02 2.03 4.

View 10 Replies

SQL Server :: How To Group Weekly Data For A Month Days

Sep 16, 2010

how to group weekly data for a month days

View 6 Replies

Forms Data Controls :: User Group List Like Graph / Get The List Of Users Under A Group

Oct 26, 2010

I need to develop a page in my applicaiton like the image for the user lists.

I need to get the list of users under a group and need to show likw this.

View 4 Replies

Access The Group Of A Linq Group - By Query From A Nested Repeater Control?

Mar 26, 2010

I'm using a linq group by query (with two grouping parameters) and would like to use the resulting data in a nested repeater.

var dateGroups = from row in data.AsEnumerable()
group row by new { StartDate = row["StartDate"], EndDate = row["EndDate"] };
"data" is a DataTable from an SqlDataAdapter-filled DataSet. "dateGroups" is used in the parent repeater, and I can access the group keys using Eval("key.StartDate") and Eval("key.EndDate").

Since dateGroups actually contains all the data rows grouped neatly by Start/End date, I'd like to access those rows to display the data in a child repeater. To what would I set the child repeater's DataSource? I have tried every expression in markup I could think of; I think the problem is that I'm trying to access an anonymous member (and I don't know how.) In case it doesn't turn out to be obvious, what would be the expression to access the elements in each iteration of the child repeater? Is there an expression that would let me set the DataSource in the markup, or will it have to be in the codebehind on some event in the parent repeater?

View 3 Replies

Forms Data Controls :: Group Data,- The Group's Header Be On The Top ?

Feb 5, 2010

I'd like to gruop data from a table, for example, by DATE or CATEGORY, something like this:
29/01/2010
News 1
News 2
News 3

30/01/2010
News 1
News 2
News 3

or group by CATEGORY, like this:

ASP.NET
News 1
News 2
News 3

PHP
News 1
News 2
News 3

View 4 Replies

Data Controls :: Group RadioButtons Inside All Templatefield Columns In GridView Row Based On Data?

Nov 22, 2015

[URL] 

Above Links Works For Only When Gridview Has All Boundfield Columns and Last Templatefield Column having Radiobutton.

 But not Works when All TemplateField Columns Having Textbox or Label in gridview like 

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" BorderColor="Black"
DataKeyNames="ID,Type" BorderStyle="Solid" BorderWidth="1px" CellPadding="4"
CssClass="Gridview" OnRowDataBound="GridView1_RowDataBound">
<Columns>

[code].....

View 1 Replies

Forms Data Controls :: How To Validate From Group Of Radiobutton To Select At-lease One Radio Button

Dec 9, 2010

I have the below code. I want to validate at least one rediobutton to be selected from the group of radiobuttons.

[code]....

In the output i am getting morethan one radio buttons depending on the data which i added in the database. Before submit i want to validate atlease one radiobutton to be selected using javascript.

View 10 Replies

SQL Reporting :: Combine Column Group Columns Into One?

Oct 11, 2010

I have a dataset like this:

BidID....DistributionMonth....LbsRemaining

1...........08-2010.................50,000

1........... 09-2010................25,000

1............10-2010................25,000

1............11-2010................100,000

I have a report that shows this data by pivoting on the month and giving the remaining amount, like this:

BID......Aug-2010 Remaining........Sep-2010 Remaining.......Oct-2010 Remaining........Nov-2010 Remaining

1..........50,000...............................25,000...........................25,000..............................100,000

This all works just fine. However now, I want to take a date that's given, and make a "Past Due" column for anything less than the first of the month of that date.

View 4 Replies

C# - Group Select New GetTable<>?

Apr 4, 2011

DataContext db = new DataContext(conString);
var dvd = db.GetTable<DvdList>();
var query = from b in dvd

[code]...

View 2 Replies

Controls :: Export GridView With Group Header Row Columns To PDF?

May 7, 2015

How to convert a gridview consists with sub columns to a pdf without changing the format of sub columns

View 1 Replies

Forms Data Controls :: Checkbox Selection Based On Group Column Values In Gridview?

Jul 28, 2010

I have to select checkboxes besed on group column values. If you see below gridview, column 3 (GroupN) has 1,1,1,1,2,2,2,2....etc (this column data is not static, will change based on page index. i.e PageIndex =2 may starts with 7,7,7,8,8,8,8,8,9,9,9 etc).

Now My question is.

1). If user selected '1', we have to store value and user must and should select another '1' (atleast two times).

2) If user selected '1', and user trying select '2'. Giving error says "Must have select one then one record in group to combine' (will not allow) and unselect '2'.

3) If user selected '1' atleast two times, and user trying select '2'. Will allow.

4) If user selected '1' atleast two times and selected '2' one time, trying to select '3'. will not allow user to select '3'.

View 3 Replies

Visual Studio :: Group Profiles Settings - Users In The Group Update The Same Settings?

Jan 19, 2010

We have many different clients, and each client can have multiple user accounts.Right now, we have user settings set up on the ASP project, and a WinForms application can see these settings, depending on which user logs into the winforms application. They are specific to the user. I want to make them specific to the client, so users can be in "groups" by their client, and all users in the group would see/update the same settings.

View 1 Replies

Data Controls :: How To Group Row Values By Grouping Data In GridView

May 7, 2015

I am binding gridview details from the datatable,  i need to use groupby in gridview.

View 1 Replies

How To Select A Group Of Buttons That Changed Color

Dec 8, 2010

how can i select a group of buttons that changed it's colour and i have to save it's textt as value in database can i do that

View 3 Replies

DataSource Controls :: How To Select Top X Records From Each Group

Apr 7, 2010

i have two tables (Users, Roles) and each user belongs to one role. Can I make a sql query that returns 10 newest users from each role in one query?

View 5 Replies

Databases :: Multiple Select With Single Group By?

Jun 24, 2010

if we are trying to add the several columns in select statement and only one condition in group by.

how can we do that ?

Example:

[code].....

View 1 Replies

Web Forms :: How To Get Four Values As A Group From Arraylist

Dec 7, 2010

I want to add four values to the arraylist when i click on UP button. and if i click on UP button again i need to add four more values to arraylist.

While getting the values from arraylist i need get four values at a time and so on .

View 1 Replies

Bind TextBox Default Values As A Group?

Jan 20, 2011

I'm making an "Edit Customer" page in asp .net and want to enter in all the current values into the TextBoxes on PageLoad. Is there a way to do this using databinding, or do I have to get the Customer from the DataContext and then set the TextBoxes line-by-line? ie

firstNameTB.Text = Customer.FirstName;
lastNameTB.Text = Customer.LastName;
...

View 2 Replies

Web Forms :: Group (Remove) Duplicate Values From DropDownList

May 7, 2015

I have a master table relationship, i.e. depending on what is selected in the dropdown list the grid show the relevant data.In the database there are several identical entries for the Position field, for instance there are four marketing managers that have different name. How can i group the identical Position name in the dropdown and when selected the grid should display all marketing managers. Here is the code:

<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="sqlDdl"
DataTextField="ID" DataValueField="Postion">
</asp:DropDownList>
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="sqlCon" EnableModelValidation="True">

[Code] ....

View 1 Replies

DataSource Controls :: Selecting Columns From A Datatable Using Select Method?

May 7, 2010

I would like to select some columns from a Datatable, I mean, something like Select Name, Surname, ID,

I'm trying to do something like this:

DataTable dtExcel = new DataTable();
DataRow[] buena = dtExcel.Select("NAME");

in order to get only a view or table with one column (NAME).

View 1 Replies

Databases :: How To Display Data By Group

Jan 12, 2011

Im a newbie in sql.. I have a query which display a list of program by college..This is the example:

my problem is the user wants the report to be display followed by college..like this:

i try to do select by select query but incorrect..anyone having the same xperience...?

View 5 Replies

Web Forms :: How To Group Data In Dropdownlist

Aug 6, 2010

How to group data in dropdownlist

i am binding dropdownlist from databse

[Code]....

and i added two list items in code

[Code]....

View 1 Replies

SQL Server :: How To Group The Data Query

Dec 22, 2010

I am using SQL Server 2005. I have below table:

CompanyNo CompanyName Product

--------------------------------------------------------

100 C1 P11

100 C1 P12

100 C1 P13

200 C2 P21

200 C2 P22

etc...

And I want my sproc returns like...

CompanyData

------------------

100 - C1 - P11, P12, P13

200 - C2 - P21, P22

etc...

View 3 Replies

Web Forms :: Group Data In Dropdownlist?

Dec 13, 2010

How to group data in dropdownlist

i am binding dropdownlist from databse

[Code]....

and i added two list items in code

Me.ddlModule.Items.Add(New ListItem("Colors", -1))
Me.ddlModule.Items.Add(New ListItem("Depts", -2))

i have table in db

objectno objectname
101 red
102 blue
103 Hr
105 Dept
106 white

View 2 Replies







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