.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

How to get one specific row to be the last row returned from a query?

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
 I have a table of skills.  In that table, are rows of data with various skill type.  I need to return a list of those skills in alphabetical order, with one exception.  The skills "General" can't be listed in the "G's", instead, it needs to be the last item.  (Crazy, I know, but it's to discourage users from settling on a selection of "General".  This statement returns all the skills in alphabetical order, but "General" is listed right in the middle with other "G's:SELECT SkillsID, Skill, SkillDesc FROM tSkills  ORDER BY Skill

View Complete Post

More Related Resource Links

MDX query to filter on specific dimension attributes

Ok, trying to figure out how to filter on specific dimension attributes. Are there any suggestions? I have a measure that needs to be filtered by a dimension that has numerous attributes (20 attributes in total) but I only want to show that measure against 10 of the attributes and once I get that result I need filter that result set against my time dimension (which this part I have figure out)   This is what I have so far: With member [calculated_measure_name] as ( [measures].[count_of_people], { [dimelgiblestatus].[elgible].[elgible1], [dimelgiblestatus].[elgible].[elgible2], [dimelgiblestatus].[elgible].[elgible3], [dimelgiblestatus].[elgible].[elgible4], [dimelgiblestatus].[elgible].[elgible5], [dimelgiblestatus].[elgible].[elgible6], }   )   Select [calculated_measure_name] on columns, [date].[fsicalyear].&[2008], [date].[fsicalyear].&[2009], [date].[fsicalyear].&[2010], [date].[fsicalyear].&[2011] on rows from mycube   When I run it, it gets no errors but in the result set for the numbers I get "#error"; do I need to basically create a subcube in order to get the result like I would like? If so how would I start doing that?   ThanksNetwork Analyst

Comma Separated list returned from XML query

I found an example of how to do this, but I must have something wrong as I can't get it to execute without syntax errors or errors. Here's an example XML:   <GrantList> <GRANT SAPGrantNumber="12345" PersonID="168658" SequenceNumber="9" ItemTypeID="1" > <PEOPLE Investigators="Smith, Many" /> <PEOPLE Investigators="Brown, Esmond" /> <PEOPLE Investigators="White, Christine" /> <PEOPLE Investigators="Saga, John" /> <PEOPLE Investigators="Mog, Maureen" /> <PEOPLE Investigators="LastName, FirstName" /> </GRANT> <GRANT SAPGrantNumber="12645" PersonID="168658" SequenceNumber="10" ItemTypeID="1" /> <GRANT SAPGrantNumber="16546" PersonID="168658" SequenceNumber="11" ItemTypeID="1" /> <GRANT SAPGrantNumber="684684351" PersonID="168658" SequenceNumber="12" ItemTypeID="1" > <PEOPLE Investigators="Smith, Many" /> <PEOPLE Investigators="Smith, John" /> <PEOPLE Investigators="Mog, Maureen" /> <PEOPLE Investigators="Xiansa, Ming" /> </GRANT> </GrantList> Here's my query where the xml above is in the

Incremental processing - do I need to provide specific query?



I have read a few thread on this subject but I didn't get a clear understanding on how incremental processing works.

My question is.. I have a Fact view with with TimeID,Computerid as primary keys. I would expect when I do an incremental processing that SSAS figure out for which keys the cube doesn't have data and insert the missing ones. However, it looks like you have to specify the query to determine the data that should be incremented in the cube, is that right?

How could I do then if my TimeID isn't populated sequentially? For instance, I could write a query to get only today's data but it's very possible that tomorrow or the day after there are still some late rows being inserted with todays timeID but at that time my query would miss these rows. Please let me know if the explanation is a bit confuse.


How do find what query is being executed on specific session ID?



I have a SP which writes to a table all processes which are being executed when application decides to stop waiting for results of the query. It works very well but problem is that it does not dump all SPIDs but only some of them which are being executing for a long time. Common pattern that a lot of SPIDs will be blocked by single SPID which will not be part of the output which is being generated. How do I dump all SPIDs and what they are doing along with SP below?


 'blk object' = t1.resource_associated_entity_id,

 (SELECT SUBSTRING(text, t3.statement_start_offset/2 + 1,
 		(CASE WHEN t3.statement_end_offset = -1 
 			THEN LEN(CONVERT(nvarchar(

Nhibernate query ? specific field


how to pick a specific field (besides Primarykey field ) through HQL query ???

Query XML returned sting



Im working with an API that returns an XML string containing information i need to query and present in datacontainers such as the gridview. Can i put the XML string into xml datasource and query it or is there a better way? Any code samples would be a great help.





SSRS: Reconciling what is printed with what is returned in the query


Thanks for everyone's help.  I need some advice on printing a report; I'm using Visual Studio 2005.

Say I have the following three tables:

Table 1: ClassRoom

ClassRoomID ClassRoomName
1 1A
2 1B

partial mysql data returned from a query..


I been struggling with this for about two days.. Please give me a pointer at the right direction..

So the connection string I am using is MySql.Data.MySqlClient. I have been able to retreive data back using the below connection.

    Function Query(ByVal sql As String) As DataTable
        Diagnostics.Debug.WriteLine(">> " & sql)

        'Dim Connection As String = "Server=server.host.com;Uid=user;Pwd=password;Database=dbName;"

        Dim conn As MySqlConnection = New MySqlConnection(Connection)
        Dim adp As New MySqlDataAdapter(sql, conn)
        Dim dt As DataTable = New DataTable
        Catch ex As Exception
        End Try
        Return dt
    End Function

The problem I am having is I am trying to bind a some data to a dropdownlist. Below is the Sub that should bind the dropdownlist..

    Sub GetRestaurantList()

        Dim sql As String
        Dim dt As DataTable
        Dim ddl As DropDownList = ddlRestaurant

        sql = "SELECT concat_ws(' || ',m.Name, r.Address, r.City, r.zipCode) Name, concat_ws('|',m.Menu_ID, r.Restaurant_ID, r.guid) id F

CAML query to check if user is member of a specific group


I've got a nested query caml which basically should check 3 things:

  1. Check if a task has been assigned directly to the ucrrent user
  2. Check if a task has been assigned to a group the user is in
  3. Check if the user is member of a specific

The first to bullet points work like a charm, but I can't figure out how to get the last one to work. Here is what I thought should work:

query += "<Where>";
query += "<Eq><Membership Type=\"CurrentUserGroups\">";
query += "<Value Type=\"String\">Name of my specific group</Value>";
query += "</Membership></Eq>";
query += "</Where>";

Somehow it doesn't seem to be the correct approach, is there somebody who can help me out on this? Thanks

How can I find from a single query that a user has which permission on a specific table


Hi All,

How can I find from a single query that a user  has which permission on a specific table. I have a Table named "Property_Address" and a User "ABC" doing update on this table. How can I revoke permissions on this table from this user and how can I find which permissions this user have on Property_Address Table.

Any help would be appreciate.

Caml Query to fetch the data from Sharepoint List for a specific date.



I have a sharepoint list with one of hte columns being Created Date of Type DateTime and value allowed is OnlyDate.

The submitted date in my column is 05/18/2011. When I perform a search using the below CAML query, it does not give any results though I have two items with this date.

<Where><Eq><FieldRef Name='Date_x0020_Created' /><Value Type='DateTime'>5/18/2011</Value></Eq></Where>

I dont understand what is wrong with this query. Someone please help

Janaki Thakur

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

Button specific code


I have 2 submit buttons on my page. Right now, the only way to run the code behind with razor is to to If(IsPost). Since I have 2 buttons, how would I destinguish between the two in post? Is there a way to request a button that sent a post request?  

Where to Filter the companies returned by the EF?



I am just starting with dynamic data. I have an enttity framework called UsersModel.edmx.

It returns a list of all companies in the tblCompany table. This list is really big.

I need to filter the list returned to all user controls on the client so that it only returns the company that have a CompanyTypeId= 2 or CompanyTypeId= 3 and company name != "".

1 - Is it possible to filter the company list returned on the server so that I can filter only once for all the controls that use that on the client?

My ideas was to do something like this using linq and lambda but I am not sure how:

return tblCompanys.Where(c => c.CompanyTypeId == 2 || c.CompanyTypeId == 3 && ).Where(c=>c.CompanyName != "").OrderBy(c => c.CompanyName).Distinct().OrderBy(c=>c.CompanyName);

2 - I have created a partial class and a metadata class and added the DisplayColumn attribute to use the company name and sort by company name ascending.

Could I use the code to filter the returned companies in this? where?

namespace MarsMedicalModel
    [DisplayColumn("CompanyName", "CompanyName")]
    public partial class t

sql query that don't run



I'm going crazy... i've got a piece of code that don't update the database... Could somebody tel me why it doesn't run??

Dim conn As SqlConnection
        Dim cmd As SqlCommand
        Dim cmdstring As String = "Update Corsi Set [Contenuto]='" & TxtText.Content & "' Where [ID]='" & Request.QueryString("Id").Replace("'", "") & "'"
        conn = New SqlConnection(SqlAnni.ConnectionString)
        cmd = New SqlCommand(cmdstring, conn)
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