DataSource Controls :: How To Bring The Particular Result Through Queries

Feb 11, 2010

(ie.)C-Chennai
B-Bombay
-Hydrabad
A-Andhra
K-Karnataka

It may comes any order but (cbhak) is constant. i need to bring this in query, i dont want to use any funtionHow can i acheive this result

View 2 Replies


Similar Messages:

DataSource Controls :: How To Bring The Result Without Using Cursor

May 13, 2010

Tag TableName FieldNameabc wc s_namelbl wc s_deslb2 wc s_prodin above fieldname(s_name,s_des,s_prod) column represent field in wc table.How can i bring this result. is this possible without using cursor. i was struggling past two days. i cant able to bring result for above.

View 17 Replies

DataSource Controls :: How To Check Two Queries Return Result Is Same

Feb 26, 2010

how to wrote stored procedure for check two queries result this result is same return true value its not same return false value

View 2 Replies

SQL Server :: How To Bring Distinct Result

Jan 5, 2011

I need to bring the distinct result in third columnBelow one is my sample table

[Code]....

View 19 Replies

DataSource Controls :: When Add A Object Datasource To Page, It Bring Only Common Layer Classes?

Mar 10, 2011

i have problem white Object datasource. i have a multi-tier Application that include common layer ,DAL Layer,business logic and persantation layerwhen i add a object datasource to my page, it bring me only common layer classes . but i want use bisuiness layer classes what do i do ?

View 1 Replies

DataSource Controls :: How To Write SQL Queries

Mar 5, 2010

SELECT 1000000*QuantityNC/Quantity AS PPM FROM [table1] However I need my WHERE clause to do thisI need the above calculation depending on BusUnit, which is linked to PartNumber, which is in the above table. also it has to be by Company (which is selected from a dropdown). And also based on the current month and year.

PartNumber and CompanyName are in [table1]
BusUnitID, PartNumber, SupplierID, are in tblParts
BusUnitID and BusUnit are in tblBusUnits

View 2 Replies

DataSource Controls :: Run Queries From Website?

Jun 28, 2010

I need to fire sql queries in my website and get the results from the Database. for example: I will give select * from emp in a text box. It shud return the results for me. DO any of u have a sample/links of such application, through which i will be able to implement in my application share me the links/sources/app if u have any.

View 2 Replies

DataSource Controls :: Perform Sql Queries Onto Vb.net And Display Them?

Apr 26, 2010

I get from SQL Server Server Data. I need to use datas form 2 colums of my SQL query for a VB.NET. The VB.NET need 2 values for both colums and produce 1 answer. I what to display the value on the same line instead of the 2 1st values. How can i store the 2 colums wich lot of SQL values on my vb.net script and diplay the result with the other data from the SQL query ?

View 3 Replies

DataSource Controls :: Combining Two Queries - Count For Each City As Whole

Feb 4, 2010

I know there has to be a way to do this but for some reason I keep getting it wrong. I have one query which pulls all of the cities from a zipcode database like so:

[Code]....

Then I have another which counts the records from a transactions table per city, like so:

[Code]....

Only the zipcode is stored in the transactions table, so the idea here is to get a list off all the distinct cities that reside in the state. Once I have the cities, I want a count for each city as a whole, so I need to go back in and get all of the zipcodes that make up one city, and then count the transactions for those zipcodes. It works using the first query above, looping through them and then executing the second for every pass. But shouldn't there be a way to do it all in one query?

View 4 Replies

DataSource Controls :: Data Retrieving And Checking Queries?

Jul 28, 2010

I'm currently working on a FOREX Live Trading project that I'm implementing.

I already have a database that stores the CURRENCY PAIR, BUY/SELL, PRICE AND QTY.

But I have a huge problem.

Scenario that is:

A person BUYS EUR/USD at a PRICE of 1.29900 @ quantity 100,000. (This will be recorded in the database table)

Then he BUYS EUR/USD at a PRICE of 1.29950 @ quantity 100,000. (This will then be recorded in the database also)

Then he decides to SELL his EUR/USD at a PRICE of 1.31000 @ quantity 200,000 all out. (How can I check from the database if he previously had make a transaction of BUY/SELL, so that I can do my necessary calculations for the P/L Statement)

View 3 Replies

DataSource Controls :: Queries Not Returning Proper Data?

Mar 17, 2010

I am having trouble with queries because they are not returning the data needed, and I am having trouble figuring out why because I only am testing with 2 records.First I want a query to return all records for one customer as follows:

[Code]....

There are two records with the customerID of 1, but it only returns one,next I try to return only one record, the AccountPrimary or customer_contacts.IsPrimary, but when I add " AND customer_contacts.IsPrimary = 'True' "at the end of my query it then returns both records, but only one IsPrimary = True and the Other = False. Is it backwards? I also tried another method and it returned 30 of the same record and I only have 2

View 4 Replies

DataSource Controls :: Filter SQL Queries Based On The Store ID Associated With A User ID?

Jan 16, 2010

I am planning a project for a pharmacy to enter quality control data to generate reports and graphs with Crystal Reports. There are 20 stores, I need to password protect the entrance page, giving each store their own username and password (just one per store is fine), allowing the store to only access that store's data. Each store will have an associated ID in the MSSQL table.I am using the Membership Provider. I know I need to implement user roles for Managers and Stores levels (Managers can run reports for all stores), I wonder if I can set the default store ID for insert/edit templates after that specific store logs in.Basically, I think I need to filter SQL queries based on the store ID associated with a user ID. I have seen a .NET site that, after logging in, you type in a store id into a textbox, and it gives you access only to that stores data. Something like this would work for my situation.Can anyone explain or show me an example for the best method to accomplish this with C#?

View 2 Replies

DataSource Controls :: LINQ To SQL - Multiple Queries Doesn't Return Any Results

May 25, 2010

I am working on asp.net 3.5 and in MVC using Linq to SQL classes. In my MVC project i am calling stored procedure using linq to sql that conatin query joining two tables.Below is my code in Partial class

[
Function(Name="dbo.GetUserWiseThreadDetail_SP")]
[ResultType(typeof(Thread))]
[ResultType(typeof(Reply))]
public
IMultipleResults GetUserWiseThreadDetail_SP([Parameter(DbType="VarChar(30)")]
string userID)
{
ExecuteResult result = this.ExecuteMethodCall(this,
(MethodInfo)(MethodInfo.GetCurrentMethod())), userID);
return ((IMultipleResults)(result.ReturnValue));
}

In one of the controller i have made one more class

public class
MypostIndexData
{
public
IEnumerable<Thread> Thrds {
get;
set; }
public
IEnumerable<Reply> Repls {
get;
set; }
public MypostIndexData(IEnumerable<Thread>
thrds,IEnumerable<Reply> repls)
{
this.Thrds=thrds;this.Repls=repls;
}
}

finally coding of controller action method

ForumDataContext pmforum = new
PMForumDataContext();
public
ActionResult MyPosts(string userId)
{
IEnumerable<Thread>thrds;
IEnumerable<Reply>repls;
IMultipleResults result = pmforum.GetUserWiseThreadDetail_SP(userId); (this satement doesnot give any result,if i execute stored proc in
sql it give the results)
thrds = result.GetResult<Thread>();
List<Thread> thrdlist =
new
List<Thread>(thrds);
repls = result.GetResult<Reply>();
List<Reply> replylist;
if (repls !=
null)
{
replylist = new
List<Reply>(repls);
}
return View(new
MypostIndexData(thrds,repls));

I am unable to understand why i am not getting any results?

View 5 Replies

DataSource Controls :: Combine The LINQ Queries Together And Have Access To Both Of The Results Independently?

Feb 25, 2010

Is there a way to combine the LINQ queries together and have access to both of the results independently?

[Code]....

View 10 Replies

DataSource Controls :: Return Number Of Rows Affected For Multiple Queries In One SQLCommand?

Feb 22, 2010

I am accepting query/queries from user (our support team) in a text box where user can enter only one query or multiple queries. I need to display result of all queries entered in the textbox. If it is SELECT statement then result of that statement in grid which is done. If UPDATE/INSERT/DELETE then total number of rows affected which is also done but if only one UPDATE/INSERT/DELETE statement is entered in the textbox.

If user enters 2 UPDATE statements and then a SELECT statement then how can I get number of rows affected for individual UPDATE statements just like SQL Server Qury Analyzer displays messages in its result pane.

e.g.

(6 row(s) affected) -- first UPDATE statement

(4 row(s) affected) -- second UPDATE statement

(16 row(s) affected) -- for SELECT statement (grid will also be displayed along with these messages).

I tried almost everything, SqlDataSource (returns count of first statement only), SqlCommand.ExecuteNonQuery and DataAdapter.Fill (returns count of last statement only).

View 3 Replies

DataSource Controls :: Table / Database Design Theory - Return Faster Queries

Feb 5, 2010

In general terms, which way will require more server processing power and which way will return faster queries... if there is even a difference. The client's database is still on the dev MS SQL server but is essentially but the client has decided they want to collect two more fields of information. Both fields are going to be collection text data and probably varchar(300) will be sufficient for the column data types. Would it ultimately be more efficient to

Add two additional columns in the main table so the data is entered directly into each record, or Add an additional table (or two) with a foriegn key to the primary table that holds the info for each new field The SELECT statement for the main table could be modified to either add the new columns (a.NewColumn1 and a.NewColumn2) or it could contain nested SELECT statements that pull in the data from the other tables. Custom daisy-chained Insert or Update statements would be no problem and a cascade Delete relationship would take care of any deletions. I'm just trying to figure out which would be better from a performance standpoint?

View 3 Replies

Forms Data Controls :: Datasource Update / Delete Queries For Gridview - Can't Edit

Dec 7, 2010

I have a gridview that pulls data from two tables, CLIENT and PAYMENT. I want to add the edit, delete functions to the gridview for the payment portion of the table, that is to edit or delete the payments but not the client. I've manually enabled the edit, delete functions and input the queries. I've also deleted the textboxes from the templates which draw from the CLIENT table so they cannot be edited. Everything looks good on the surface until I actually go to edit or delete anything, and it has no effect.Here's the structure of the two tables:

CLIENT PAYMENT
ClientID Pk PaymentNumber Pk
FName CLIENT$ClientID Fk
LName PaymentDate
ContactNo NULL PaymentAmount
ArrivalDate PaymentDetails NULL
DepartureDate NULL
CurrentResident

Here's the update query:

UPDATE [PAYMENT] SET [PaymentDate] = @PaymentDate, [PaymentAmount] = @PaymentAmount, [PaymentDetails] = @PaymentDetails WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate
AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails) OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))

Finally, here's the delete query:

DELETE FROM [PAYMENT] WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails)
OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))

View 3 Replies

DataSource Controls :: How To Get Result With Decimal Places

Jan 29, 2010

How can I get the result with decimal place? The following will return 33.00, but how can I get the result of 33.33?

[Code]....

View 2 Replies

DataSource Controls :: Get Itmcod Wise Result In 1 Row?

Feb 4, 2010

Table: ITMLED

Recsno itmcod opeqty inwqty isuqty
6200 001 500 NULL NULL
442 001 NULL NULL 100
22 001 NULL 700 NULL
23 001 NULL 500 NULL
443 001 NULL NULL 400

How do I get itmcod wise result in 1 row like

ITMCOD, OPNQTY, INWQTY, ISUQTY, ((OPNQTY+ INWQT) - ISUQTY) AS CLOSINGQTY
001 500 1200 500 1200

From above data in ITMLED.

View 4 Replies

DataSource Controls :: Want To Display Result Even If One Value Is Just Present?

Jun 4, 2010

How can I do this? I want to display result even if one value is just present. I've tried messing with the logical operators but still can't get it. Here is my SelectCommand.

[Code]....

View 10 Replies

DataSource Controls :: Write SQL Query Result To Label

Mar 22, 2010

I have the following code which writes to a Gridview:

[Code]....

Using the same methods of connecting to the database, how can I amend this code to write the result of a second query (which only returns a number) to a label?

View 11 Replies

DataSource Controls :: Dynamic Sql Result Set Into Linq To Sql Designer?

Apr 13, 2010

I have one sproc with Dynamic Temp Table. Sproc returns dynamic temp table rows and when I drag and drop the sporc on to Linq to Sql Designer I am not getting Return Type as "(Auto-generated Type).

how can I get Return Type as Auto-generated Type.

View 1 Replies

DataSource Controls :: Populating Listbox With Directorysearch Result?

Mar 11, 2010

I'm creating a user control that enables users to search AD and add the selected names to a list (which is used to send mail lateron).

The problem is that the search results end up in the Listbox but all as the string "System.DirectoryServices.ResultPropertyValueCollection" in stead of the actual values.

I have no idea why.

This is my code:

[Code]....

[Code]....

View 5 Replies

DataSource Controls :: Combine Two Result Sets From One Table?

Jan 6, 2010

I have a table that contains a date column along with others. I need to extract two sets of data from this table for two different time periods. Call them Current and Previous, so that I can compare them line for line. There are exactly the same number of days in both time periods.

The problem is that I need to return the data like this:

CurrentDate, Count(CurrentItems), Sum(Amt), Count(PreviousItems), Sum(PrevAmt)

JOIN puts the data into the result vertically, so that doesn't work. So far, I have not found a method that will arrange the data correctly.

View 1 Replies

DataSource Controls :: Accessing The Result Set Of A Stored Procedure - How To Fix This Error

Jul 27, 2010

I'm programming a webpage in ASP.NET which displays a list of students not listed as participants in something, and upon clicking a student name shows you a brief summary of their details, so the user can ensure they're selecting the right person. Each student is identified by a unique ID.

My code currently correctly obtains their ID, adds it as a parameter to my stored procedure and executes the procedure;

[Code]....

However, when I try to access the results, with say dv.Table.Rows[0], I get the following error:

[Code]....

Upon debugging, there don't seem to be any results returned... when running just the stored procedure in SQL Server with the same data, it does return a single row, as expected.

View 2 Replies







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