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

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

Please Provide the result in my Expected Format

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :Sql Server
Table:   Doc Sno A 1 B 2 C 3 Expected result is   Doc Sn1 Sn2 A 1 2 A 2 3 A 3 1 B 1 2 B 2 3 B 3 1 C 1 2 C 2 3 C 3 1 Ramesh.M

View Complete Post

More Related Resource Links

Please provide the data in expected format.


Please find the below table


Doc Build

I want the data in below format.


Doc Build1 Build2

Date format in Search Core Result web part

Hi, I have two Site Columns PublishedDate and GlobalTitle. They have datetime and string type. These site columns are added to the Custom List. I need to show these columns in Search Core Result web part when item is searched. Because of this reason I created them as Site columns and Mapped with crawl property in SSP. After doing full crawl I can access both site columns in Search core Result. GlobalTitle is displayed properly but problem is with PublishedDate. It shows System.DateTime[] only. Can any one help me to show this in any of the date format but not like System.DateTime[]. Many Thanks in advance Chirantan

"This feature installing a form template does not match the expected format" error


I'm trying to create a new SP Feature that consists of the following components -- an InfoPath form, a document library (list) where these forms will be used, and a custom Task list (that will be used in a workflow that is triggered when the form is submitted).  Each of these components was created in a DEV env and is working.  I then created my feature in Visual Studio 2008 and successfully created the WSP file.  I then (successfully) installed the WSP (I got no errors on install and all seemed well -- the "solution" shows up under Central Admin and shows as being deployed. 

When I go to site settings, the feature shows up, but deactivated.  WHen I attempt to activate it, however, I get this error in the SP Logs:

09/24/2010 09:38:19.12  OWSTIMER.EXE (0x07C4)                    0x07F0 Forms Server                   Forms Services Deployment      

82mz Exception FeatureInstalled failed with unhandled exception Microsoft.Office.InfoPath.Server.Util.InfoPathLocalizedException: This feature installing a form template does not match the expected format: CAPital EXpenditure Request. Refer to the

Please provide the data in the below format.


Table looks like this


Sno Text
1 AB
2 ZB
3 CA
4 TQ

And i need the output will be like this (1,2);(1,3);(1,4);(2,3),(2,4);(3,4).It means i need output in the below format.



How to change data format in result coming from SQL table


On one of my webpage i am displaying datalist in which i am using this label:

<asp:Label ID="nameLabel12a" runat="server" Text='<%# Eval("CreatedOn") %>' />

This label is displaying created on date along with time (10/18/2010 2:45:07 PM), but i would like to display it something like this:

7sec ago

20min ago

30min ago

23 hours ago

10/3/2010 (if the time is more than 24 hours then it should display the date)

how to accomplish this ? please guide me...

Alternet Access Mapping is not producing the expected result


I have a web application at http://servername:portUmber. I want the site to be accessed through an address like: http://This.this.com.

in alternate mapping, I added an internal url > selected my collection > entered the http://This.this.com for "URL protocol, host and port. > changed the zone to interanet.

The site is working with port number but not with the alternate access mapped name.

rCentral Administration > Operations > Alternate Access Mappings  shows http://This.this.com for the internal URL and Public URL for zone in the


What am i missing?


Aggregate (count) function that produces a different result to what is expected.

Hi Folks
I have an aggregate transformation, that runs a count on a column.  The  column  has 23 rows  with dates and a further 2 rows that have no date information. When I run a count function on the column, it returns a count of 25.  My hypothesis is that  this is linked to the 2 rows are treated as being  BLANK as opposed to being NULL (I understand the COUNT function will not count rows that have null values).

I have two questions
1) How do test this hypothesis that he difference is due to a blank vs null issue and then more importantly
2) How to I resolve the issue so that the 2 "empty" rows are not counted?

Many thanks


How To Set a Date Format In GridView Using ASP.NET 2.0

A very common desire is to set a column of a gridview to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the boundfield attribute (
The problem is that if this field is enabled, you can not pass format information to the boundfield control. That is, if you try the following code, you will not get the desired result.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

How to format datetime & date with century?

Execute the following Microsoft SQL Server T-SQL datetime, date and time formatting scripts in Management Studio Query Editor to demonstrate the usage of the multitude of temporal data formats available and the application of date / datetime functions.


Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Format Generic List Bound to Gridview


I have a generic list of a custom type. The custom type has a string and double.

I'm binding the list to a gridview and it outputs everything fine.

I'm trying to format the double column into a currency format. It is in a template field as I'm calculating a running total. I pass the value to a function that returns a double and adds the current value to a running total which I will show in the footer.

The format is not changing to currency as expected when using String.Format("{0:c}", GetTotal(Convert.ToDouble(Eval("Amount"))))

Any ideas on what might be going on and how to fix this?


Active Directory and .NET: paging the search result

Hi everybody!

I have a question about Active Directory in .NET
For my project I need to fetch results from Active Directory search page by page, because later I would need to bind it to the pageable DataGrid.

I tried to use .NET library DirectoryServices for that, but paging provided by this library is transparent to the user and is used only to increase the efficiency of searching, when results are too big. I.e. I cannot tell the DirectorySearcher to give me first page, then the next or previous page, it returns me all resulting pages in one bundle.

However, what I need is to explicitely get page after page directly from the AD searcher and to be able to go at least one page forward or backward.

The solution with copying all results to the DataBase and then do the paging is not accepeted by the clent, since it is too inefficient. And since it's a Web app, I cannot keep results in memory either.

I found some hints about COM Interface, but I could not find good and detailed examples or explanations. I aslo found this line of code: DirectoryServices.Interop.IDirectorySearch.ExecuteSearch(), but I don't know which libraries should i add to be able to compile this code.

If somebody could help me out with that problem, any suggestion is welcome, 'cause this issue is eating me alive :)

Thank you!

Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Windows With C++: X64 Debugging With Pseudo Variables And Format Specifiers


This month we explain how pseudo variables and format specifiers provide a wealth of information for use in debugging.

Kenny Kerr

MSDN Magazine December 2008

SQL Server 2005: Fuzzy Lookups and Groupings Provide Powerful Data Cleansing Capabilities


SQL Server 2005 offers a completely redesigned SQL Server Integration Services engine, formerly known as Data Transformation Services. It includes many new features such as built-in support for Fuzzy Lookups and Fuzzy Groupings, which help you build powerful data-cleansing solutions. This article provides an overview of fuzzy searching techniques and a dissection of the underlying fuzzy search technology implemented in SQL Server 2005.

Jay Nathan

MSDN Magazine September 2005

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