Posts

Showing posts from 2012
Decimal Validation in asp.net C# :-    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Plz Enter Only Decimal"                         ControlToValidate="txtMRP" ValidationExpression="^-?[0-9]{0,5}(\.[0-9]{1,2})?$|^-?(100000)(\.[0]{1,5})?$"></asp:RegularExpressionValidator> {0,5} - Indicate no.of digit to be allowed, so customized as per requirement.
WCF video tutorial :- http://www.techscreencast.com/tag/wcf
Simple Webservice Tutorial URL http://senseware.net/Clients/icexstore/
i ve to display data in commas in sql :- Returning a Comma CREATE FUNCTION dbo.fn_GetTherapistName(@AppCode int) RETURNS VARCHAR(1000) AS BEGIN    DECLARE @StudentList varchar(1000)    --SELECT @StudentList = COALESCE(@StudentList + ', ', '') + CAST(m.TherapistId AS VARCHAR(15))    --FROM multipleTherapy m    --WHERE m.AppCode = @AppCode SELECT @StudentList = COALESCE(@StudentList + ', ', '') + CAST(dbo.staff_Master.firstname AS VARCHAR(100)) FROM         dbo.multipleTherapy INNER JOIN                       dbo.staff_Master ON dbo.multipleTherapy.TherapistId = dbo.staff_Master.empcode WHERE     (dbo.multipleTherapy.AppCode = @AppCode)    RETURN @StudentList END

Date format in c#

http://www.csharp-examples.net/string-format-datetime/

last modified on database detail

SELECT     modify_date         ,type_desc         ,name     FROM sys.objects     WHERE is_ms_shipped=0         --AND modify_date>='yyyy/mm/dd'  <--optionally put in your date here     ORDER BY 1 DESC
Adding Application pools in IIS http://www.iis.net/configreference/system.applicationhost/applicationpools/add
Update one table from another table :- UPDATE #temp1 SET #temp1.t3=#temp 2.t3,   #temp1.t4 = #temp2.t4   FROM #temp1, #temp2   WHERE #temp1.row = #temp2.row
To get tempary row number SELECT ROW_NUMBER() OVER(ORDER BY ID DESC) AS Row, colnam1, colnam2  FROM table1
To get time in sql Select CONVERT(varchar(50),getdate(),108) getTime
To Display Current Week data in sql :- CREATE FUNCTION dbo.udf_DisplayCurrentWeekDateDays ( @today SMALLDATETIME ) RETURNS @WeekDateDay TABLE ( Sunday SMALLDATETIME , Monday SMALLDATETIME , Tuesday SMALLDATETIME , Wednesday SMALLDATETIME , Thursday SMALLDATETIME , Friday SMALLDATETIME , Saturday SMALLDATETIME ) AS BEGIN DECLARE @day INT SET @today = CAST ( CONVERT ( VARCHAR ( 10 ), @today , 101 ) AS SMALLDATETIME ) SET @day = DATEPART ( dw , @today ) INSERT INTO @WeekDateDay ( Sunday , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday ) SELECT DATEADD ( dd , 1 - @day , @today ) Sunday , DATEADD ( dd , 2 - @day , @today ) Monday , DATEADD ( dd , 3 - @day , @today ) Tuesday , DATEADD ( dd , 4 - @day , @today ) Wednesday , DATEADD ( dd , 5 - @day , @today ) Thursday , DATEADD ( dd , 6 - @day , @today ) Friday , DATEADD ( dd , 7 - @day , @today ) Saturday RETURN END GO for more reference :- http://blog.sqlauthority.com/2007/06/08/sql-server-
 How to convert table data from horizontal into vertical in sql :- declare @t table (id int, nm varchar(10), typ varchar(10), color varchar(10), qty int, txt varchar(10)) insert @t select 1, 'name1', 'type1', 'color1', 10, 'note1' union all select 2, 'name2', 'type2', 'color2', 20, 'note2' select up.id        ,up.col as sourcecolumn        ,up.val as [value] from   (        select id, nm,typ,color,convert(varchar(10), qty) qty,txt        from @t --YOUR TABLE        ) d unpivot (val for col in ([nm], [typ], [color],[qty],[txt])) up
Tricks to speed up your SQL query:- http://www.dotnetfunda.com/articles/article1949-tricks-to-speed-up-your-sql-query.aspx
Server.Transfer with parameter :-   Page 1:- Context.Items.Add(" OrderStatus", "8"); Context.Items.Add("OrderType", "Pending"); Server . Transfer ("Order.aspx");    .   Page2:-   if (Context.Items["OrderStatus"] != null) { bo.status = Context.Items["OrderStatus"]. ToString(); }
Varieties of dates available in sql server :- Declare @Date datetime SET @Date = '1/1/2011' WHILE @Date < '1/1/2012' BEGIN SELECT CONVERT(VARCHAR(8), @Date, 112) date1, @Date fulldate, YEAR(@Date) years, DATEPART(qq, @Date) quater, DATEPART(ww, @Date) yearweeks, DATENAME(dw, @Date) dayname, DATEPART(dd, @Date) dateno, DATENAME(mm, @Date) monthnam, DATEPART(dy,@Date) daycnt, DATENAME(mm, @Date) + ' ' + CAST(DATEPART(dd, @Date) AS CHAR(2)) + ',' + CAST(DATEPART(yy, @Date) AS CHAR(4)) [mm dd,yyyy], CONVERT(VARCHAR(10), @Date, 101) normaldate, DATEPART(dw, @Date) , DATEPART(mm, @Date) dateno SET @Date = DATEADD(dd, 1, @Date) END
Comparison of Repeater  , Datalist ,GridView and ListView:- http://www.beansoftware.com/ASP.NET-Tutorials/Repeater-DataList-ListView-GridView.aspx http://weblogs.asp.net/anasghanem/archive/2008/09/06/comparing-listview-with-gridview-datalist-and-repeater.aspx
select multiple   checkbox   in grdiview http://www.aspdotnet-suresh. com/2011/03/how-to- selectdeselect-checkboxes-in. html
Export gridview into excel pdf csv   http://www.aspsnippets.com/ Articles/Print-functionality- in-ASP.Net- GridView -control. aspx  http://www.aspsnippets.com/ Articles/Export- GridView -To- Word-Excel-PDF-CSV-Formats-in- ASP.Net.aspx
To create folder without any name in window7 :- alt + 255
To create favicon online: http://favicon.htmlkit.com/favicon/
Download cc3 tutorial template http://tympanus.net/codrops/category/tutorials/
Difference Between  @@identity , scope_identity() and ident_Current('tablename'):-  SELECT @@IDENTITY @@IDENTITY is limited to the current session, it is not limited to the current scope. SELECT SCOPE_IDENTITY() SELECT IDENT_CURRENT(‘tablename’) IDENT_CURRENT is not limited by scope and session; it is limited to a specified table.    
What is the information stored in the master database ? The master database holds information for all databases located on the SQL Server instance and is the glue that holds the engine together. Because SQL Server cannot start without a functioning master database, you must administer this database with care. The msdb database stores information regarding database backups, SQL Agent information, DTS packages, SQL Server jobs, and some replication information such as for log shipping. The tempdb database holds temporary objects such as global and local temporary tables and stored procedures. The model database is essentially a template database used in the creation of any new user database created in the instance.
How do I Secure My Connection String In web.config file Go to start , search for Windows Explorer Right click on windows explorer, and then select Run as an Administrator. Go to C: drive , Go to Tools Menu , Select Folder Options , in View tab Click show hidden files, folder and drives. Now , you will able to see ProgramData (hidden folder) Now Go this path C:\ProgramData\Microsoft\Crypto\RSA, you will get MachineKeys Folder For accessing MachineKeys folder you must have full access control as a user. Right click MachineKeys folder, select properties, then go to security tab. In Group or User names, select everyone, for permission, click edit to provide full access to it. Check all under Allow permission checkboxes then click OK again click Apply and OK button for completion of permission to user everyone. After providing access permission to everyone user, go to run, type CMD. Go to path , C:\Windows\Microsoft.NET\Framework\v4.0.30319 ,copy path and paste in CMD In CMD, type CD <s
Which datatypes are not supported for the DATEFORMAT ydm? Ans:  date , datetime2 and datetimeoffset data types.
In SQL Server 2012, how many index types are available? Answer: 10,12
Awesome Dashboard http://www.web3mantra.com/2011/07/15/35-best-dashboard-designs/
Awesome Menu style http://ginva.com/2011/04/108-free-css-menu-designs/ http://css3menu.com/elegant-dark-menu.html
 How to avoid unexpected postback after pressing Enter in textbox http://rudebox. editboard.com/t 173-avoid-unexp ected-postback- after-pressing- enter-in-textbo x
To resolve " Validation of viewstate MAC failed ". Here , website url for generating machine key:  http://aspnetresources.com/ tools/machineKey   here example given below after generating machine key through above web url  This is the code which needs to be put in web.config file, hope it will help you out. <system.web> <machineKey validationKey=" 7B1A0112BEDDADE43C71702052E666 F5D5DDD8CB053F085E5362DFB1B20E 29266B8D47AE0F6C3A9E370C0192ED 1C488961F7D944A21ABF9AC2186E84 58A2FB17" decryptionKey=" EBCE0AD022C8A711670C4C96BB87C4 B91A3B0DF509B579222E1410003BE4 532B" validation="SHA1" decryption="AES" />   < /system.web>
To make text glow using css .txtGlow  {      font-family:Arial, Helvetica, sans-serif;     font-size:14px;     text-shadow: 0 0 10px #cccccc;      color:#fff;  }
To send automatic email window  services http://www.intstrings.com/ramivemula/articles/sending-automated-emails-asynchronously-using-a-c-windows-service-in-conjunction-with-database-email-records-part-ii/
How to call jquery from codebehind in asp.net http://vipullimbachiya.com/jQuery/AjaxJSON.aspx
To avoid jquery conflict Kindly use the following coding... <script type="text/javascript">         jQuery.noConflict(); ...... </script> Note: plz replace $ to jQuery
Best Website for Learning css, javascript, jquery,php http://css-tricks.com/snippets/
To know the max  size in SQL Server 2012 The maximum database size in SQL Server 2012 is: By FOR SQLSERVER Answer:   524,272 terabytes
To get awesome Backgound http://www.backgroundlabs.com/
To Pick up only left content of the word   DECLARE @ desc varchar ( 100 ) SET @ desc = 'EXCHANGEUNIT P1i / SILVERBLACK/ CYRILLIC' SET @ subdesc = RTRIM ( LEFT (@ desc , CHARINDEX ( '/' , @ desc ) - 1 )) SELECT REVERSE ( LEFT ( REVERSE (@ subdesc ), CHARINDEX ( ' ' , REVERSE (@ subdesc )) -1 ) )
How to design an organization chart?  http://sivanandareddyg.blogspot.in/2012/03/how-to-design-organization-chart.html
make round corner that support in IE Also http://cssround.com/ Give Button css http://css-tricks.com/ examples/ButtonMaker/
How to find all the Stored Procedures having a given text in it? SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE  ROUTINE_TYPE='PROCEDURE'
Sql intertview http://blog.sqlauthority.com/sql-server-interview-questions-and-answers/
To know database changes --- SELECT * FROM     sys.dm_db_index_usage_stats AS usage_stats INNER JOIN sys.tables AS tables ON tables.object_id = usage_stats.object_id WHERE     database_id = DB_ID() AND     tables.name in (select name from sys.tables)
Protecting Connection Strings and Other Configuration Information (C#)