.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Multiple Dataset in one table

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Sql Server

Hi All,

I have one table with three column say


where A is Metrics column ,B having sum (Metrics) of one day ,C having sum(metrics) of 2 days as below


Metrics                          1 day                                             2 day

A                      12 (Value of Column B)           67 (Value of Column C)



B and C will come from different dataset,kindly sugest how to do this,i have to retreive data on the basis of Metrics.



View Complete Post

More Related Resource Links

merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

SQLCE table column DefaultValues don't show up in XSD Dataset designer

Using Visual Studio 2008 with SQL CE 3.5, I notice that default values in the creation scripts for the database tables are not reflected in the dataset designer XSD file.  For example, the following SQL script creates the non-nullable table column names "Content" with a default value of 'Image':    "Content" nchar(20) NOT NULL DEFAULT 'Image',But in the column properties of the dataset designer (XSD) panel, this column correctly shows up as non-nullable, but with a DBnull default value as follows:     Name: Content    Allow DBnull: False    DefaultValue: <DBnull>Am I missing something somewhere, or is this a VS bug?  Also, how do I get the XSD file to regenerate after schema changes in the database?  Sqlmetal doesn't do it.Thanks,    -BGood

C#: How to add a row to a child table with a DataSet backing?

On the back end I am using XML files, xsd schemas a DataSet(dsThingPrograms) and DataTables. I have a parent ->child table relationship defined through the DataSet designer as such:   things[RFID(pkey), name] programs[ID(pkey/autogen), name, path, thing_RFID(FK references things->RFID)]   In my code I have:   dsThingPrograms.things.AddthingsRow("lala" , "00ffe4" ); dsThingPrograms.things.WriteXml("path\to\things.xml" , System.Data.XmlWriteMode.WriteSchema);   which works fine. However the problem comes when I try to add a row to the Programs table. When I do:   dsThingPrograms.programs.AddprogramsRow("someprog" , "some\path" , <???>);   VS wants me to add a "dsThingPrograms.thingsRow parentthingsRowByFK_things_programs" where the <???> is. I've tried a bunch of things but I could not satisfy that requirement and can't even get the code to compile. What is supposed to go in there to satisfy the FK property?

How 2 join Multiple Keys based table???

I have a table INC with 2 Columns/Fields, i.e. YR and CL set as primary keys by selecting both the columns and selecting primary key symbol with right click. How to set up a FK with the other table INC_DTL's CL which I seek to be restricted to a combination of the INC's 2 fields? Thanx in advance.

Infopath 2007 Repeating Table - Multiple Value Column Text - Hiding Rows based on Column text values

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

multiple dataset in sqlserver 2008

show the code for how to do multiple dataset in sqlserver 2008

multiple dataset in sqlserver 2008

How to do multiple datset for a single report in sql server 2008  

Multiple Source connections in Configuration Table

 I am trying to query multiple servers for properties and record those properties in a table for later use.  I can make this work with the ForEachEnumerator by querying a table. However, I would like to use the Package Configurations option if I can instead.  Any options? Is there a way to force the package to loop through multiple values for one variable, contained in an SSIS configuration table?  Thanks in advance!

setting schema as dataset to a table

hiii have an already existing schema (in a xsd file). now i need to prepare a report, so in the rdlc page i take a table. now how can i set the schema as a dataset to the table?(i'm getting an error -- "the table 'table1' is in the report body but the report has no data set.  Data regions are not allowed in reports without datasets.").  

searching SQL table with multiple parameters

I want to query an SQL table using some Web controls to provide the parameters for filtering the records in the table. Results are displayed in a GridView. I have a TextBox with an ID of "keyword" where the user may enter one or more keywords. I'd like to search 2 columns for instances of these keywords. I also have a DropDownList named "category" that lists categories contained in a "category" column of the table. I have a dataset with a TableAdapter for the table I want to search. Got it working fine with the DropDown List but not sure how to proceed with the TextBox and keywords. What SQL query should I use? The user may not enter anything into the textbox, they may enter one word, or multiple words. This is where I am now: SELECT * FROM tablename WHERE category = @category AND ?????  

group on or filter multiple datasets in 1 table?

I am fairly new to using BIDS, so please bear with me. I currently have 2 datasets, and 1 table.  The layout of the table is: Header HeaderGroup1 HeaderGroup2 Details FooterGroup2 FooterGroup2 Footer Group1 Footer Group1 Footer This is working, but what I need to do is figure out a way to add another Footer Group2 that includes an expression which involves either using data from a 3rd data set because of needing a different filter, or figuring out a way to filter the same data set twice in the one table.   I can give more specific info if you let me know what you need. Thanks!

Entities Data Models with multiple Categories using a membership table

(Using SQL Server 2008 and ASP.NET MVC2) I have a simple business table and a category table. I have a 3rd table to map business to category, a many-to-many relationship. the Map table contains a BusinessID and CategoryID. I'm lost as to how I can load the categories into my Business View Model using the entities model.Without incorporating categories, my code looks like this: var businessList = from b in entitiesDB.Businesses select new Models.BusinessViewModel { BusinessID = b.BusinessID, Name = b.Name } with Business View Model defined as: public class BusinessViewModel { [ScaffoldColumn(false)] public Guid BusinessID { get; set; } public string Name { get; set; } public List<Models.CategoryViewModel> Categories { get; set; } } but if i want to populate the Categories with the mapped categories, how would one do that?Thanks in advance for any help!

Adding a table or view multiple times when building a query with BI Report Designer and Report Build

How can I add a table/view multiple times to a single query by using BI Report Designer or Report Builder 3.0? In Report Designer I managed (workaround) to add one table multiple times by creating multiple Named Queries and having the same SELECT. Still I don't know how to add one table multiple times in Report Builder 3.0.

Most Recent records from one of the table among the tables in multiple joins.


Hi All

I have a single select query with multiple table joins in it.

I want to retrieve the Most Recent records from one of the table among the tables in multiple joins.


(select t1.col1, t2.col2 , t3.col3, t4.col4, t4.Add_Date,t5.col5,

from dbo.table1 t1

left outer join dbo.table2 t2 on t1.col1=t2.col2

left outer join

(select col3 from dbo.table3 where condition1="expr") as t3

on t1.col1=t3.col3

left outer join dbo.table4 t4 on t1.col1=t4.col4 order by t4.Add_Date

left outer join dbo.table5 t5 on t1.col1=t5.col5 )

Problem is that, I am not able to use the "Order by" for a particular table.



embedding multiple dropdowns in Table


I'm trying to embed multiple labels and dropdowns in a Table.

So I have 12 rows by 5 columns and i'm dragging dropdowns into columns 2 and 5 and text in columns 1 and 4.

It looks ok in design view but when I render to browser view it like explodes all over the page.

I can't seem to figure out how to set the column widths individually either.

Any advice?

thanks in advance

select top row for multiple entry for a date in table


My current query is

select  Date= createdon , Total=count(*) from ReportDetail where 
reportid = 9 and (CreatedOn BETWEEN '07/01/2010' AND '09/30/2010') 
group by  createdon
order by createdon desc

return data like

2010-09-21 09:36:46.493    112
2010-09-21 08:33:12.667    114
2010-09-21 07:45:20.830    176
2010-09-21 07:33:34.340    114
2010-09-20 07:27:43.753    125
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

What I am looking for

2010-09-21 09:36:46.493    112
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

Basically for 9/21, I want to get only one latest row. Please advice.

DetialsView where each row has multiple detail rows from another table


Hi everyone,

I have a <asp:DetailsView> based on a table that has a details table, like so:

DB1 --> TABLE1 --> Customers: ID, name, street, mail

DB1 --> TABLE2 --> SitesToCustomers:  CustomerID, SiteID

Problem One: I need my details view to show / edit both values from customer table and SitesToCustomers table, How do i do that?

Problem two: The site name (oppesed to its code that is saved at SitesToCustomers) is found on another DataBase in this table:

DB2 --> TABLE1 --> Sites: ID, SiteName

How can make the data source show site names according to their id's from SitesToCustomers table?

all of the code behind is c#.

Any help will be much appreciated,

and please use code examples, i'm pretty new to asp.net / c#.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend