.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

how implement run time search

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
here I have 2 sample table and their data, CREATE TABLE TempData(Employee_ID INT, Timesheet_ID INT, Employee_Name VARCHAR(50)) INSERT INTO TempData VALUES(1, 20, 'YAZD') --SELECT * FROM TempData CREATE TABLE ColData(ColName VARCHAR(50)) INSERT INTO ColData VALUES('Employee_ID') INSERT INTO ColData VALUES('Timesheet_ID') --SELECT * FROM ColData below "SELECT" returns from below query, --SELECT * FROM TempData WHERE Employee_ID = 1 AND Timesheet_ID = 20 DECLARE @Employee_ID INT DECLARE @Timesheet_ID INT SELECT @Employee_ID = Employee_ID, @Timesheet_ID = Timesheet_ID FROM TempData DECLARE @STRSQL NVARCHAR(MAX) SET @STRSQL = N'SELECT * FROM TempData WHERE Employee_ID = ' + CAST (@Employee_ID AS VARCHAR) + ' AND Timesheet_ID = ' + CAST (@Timesheet_ID AS VARCHAR) + ' ' PRINT @STRSQL now I prepare dynamic search creteria from table "coldata" and now "SELECT" is below, --SELECT * FROM TempData WHERE [Employee_ID] = CAST (@Employee_ID AS VARCHAR) AND [Timesheet_ID] = CAST (@Timesheet_ID AS VARCHAR) DECLARE @ColName NVARCHAR(MAX) SET @ColName = STUFF( (SELECT ' AND [' + ColName + '] = CAST (@' + ColName + ' AS VARCHAR)' FROM ColData FOR XML PATH(')),1,4,') DECLARE @Employee_ID INT DECLARE @Timesheet_ID INT SELECT @Employee_ID = Employee_ID, @Timesheet_ID = Timesheet_I

View Complete Post

More Related Resource Links

Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows


The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004

How to implement metadata based navigation/search to the documents

I have document library full of documents and each of items have managed metadata. I would like to create intuitive user interface where end-users can find documents based on managed metadata. I don't want to offer document library view as a first step interface. Which webpart suites to followings. Please suggest alternatives if my idea cannot be done. Case: End user select "personnel " metadata from treeview and press "OK/Search" and all documents which have the metadata personnel are listed.Kenny_I

How to implement Design-Time drag & drop from Custom Visual Studio Tool Window to WPF Designer

Hi, Could someone tell me if it is possible to intercept a design time drop event coming from a custom Visual Studio tool window onto the cider design surface? I am hoping to use the same API's as those used by the Visual Studio 2010 'Data Sources' tool window, which provides drag & drop data-binding between classes and WPF/Silverlight controls. My requirement is to pass a DataObject (used with the WPF DragDrop API) from my custom Visual Studio WPF tool window treeview to my custom WPF control at design time, read the data and do some binding/XAML manipulation of my own. The drag aspect is simple enough but I can't work out how to accept a drop event from anything other than the toolbox. At the moment, when I drag my treenode over the design surface it shows the 'cannot drop here' cursor. If someone could give me some insight into how the 'Data Sources' tool window allows dragging of treenodes to controls I would really appreciate it. It is obviously possible but which API's are used and are they public? Thanks in advance, Paul  

Can't implement Search capabilities in my C# application using Access 2003



I'm using visual c# 2005 express edition, i tried to implement full text search capabilities in my application using an Access 2003 database (of 1 table only) but i couldn't. Could someone tell me how to go about, with an example maybe? 

Thanks in advance.

How to implement "Google instant" like search


I'm trying to implement the google instant like search in my project but I dont have any ideas where to start it off.. Something like when I enter a character or start typing at the textbox, the list box will be populated every character I type.. anyone who can give me a heads up?

Fast Search Time out - No results?


Hi everyone,

I would like to knowwhat would happen if Fast search times out because of a slow connection. What results will it bring back? Would it throw an exception? What would it do? How can one work around it? to still bring back results without waiting a very long time?

Implement search


Hi all

I want to implement a search feature in my MVC application using the following routes. The property is the controller, search is the action name, then i want to have fieldname and then its actual value.


How can I modify my global.asax to accept the above?

I tried to do the underneath but unfortunately it does not work as expected since this action even gets called when the page is being rendered since the request script type=..... also calls the controller.


"Search", // Route name "{controller}/{action}/{refno}/{type}/{status}/{locality}/{pricefrom}/{priceto}", new { controller = "Property", action = "

how to implement real time olap




We are trying to implement real time olap need help on how & where to start?


Point In Time Recovery of Database with Full-Text Search enabled SQL 2005


Is this possible? 



Backup made at 10:30

changes made in system

Tail of the log backup taken at 10:35

Restore to point in tim 10:33 

At this point I get the error System.data.sqlclient.sqlerror: The File "sysft_yadayada_1" was not fully restored by a database or file restore.  The entire file must be successfully restored before applying this backup set.

BUT when I restore the database to most recent possible I have no issues..

when I do a select * from sys.master_files    sysft_yadayada_1 does not exist in that list, but  sysft_yadayada_5 does... When we were initially configuring fulltext search for this application we had a couple hiccups first till we got it working and thats the filename that ended up sticking.


Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

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.

SharePoint Gets Search Analytics

Microsoft's SharePoint Portal Server 2003 was sold into a large number of organizations based solely on the strength of the search tool. Organizations hungered for a way to find the data they had generated.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Using SharePoint Search feature in ASP.Net Application

Integrating ASP.Net application in to MOSS 2007 to utilize SharePoint Enterprise Search Feature can be done by using Business Data Search.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:
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