Sunday, June 14, 2015

Format Numbering Currency ASP VB and ASP.NET C#

Use this syntax to convert decimal or integer into currency format:

7219208.120 --> 7,219,208.12

For ASP classic:


formatnumber(YourValue, 2)

Example:
<td <%=bg%> align=right><%=FormatNumber(Rst("AMOUNT"),2)%></td>


For ASP.NET C#:

String.Format("{0:n}",YourValue)

Example:

<td align=right><%=String.Format("{0:n}",YourValue)%></td>



Best Wishes,

LadyinProgramming

Find table, view, stored procedure, etc list in database SQL Server

Use this query to find table list in database SQL Server:

SELECT * FROM information_schema.tables

Complete query for finding table, view, storedprocedure, key, etc

SELECT sobjects.name

FROM sysobjects sobjects

WHERE sobjects.xtype = 'U'


Object type:
C: Check constraint
D: Default constraint
F: Foreign Key constraint
L: Log
P: Stored procedure
PK: Primary Key constraint
RF: Replication Filter stored procedure
S: System table
TR: Trigger
U: User table
UQ: Unique constraint
V: View
X: Extended stored procedure

Best Wishes,

LadyinProgramming



Find column in table by name sql server

Use this query to find column in table by column name in SQL Server:

SELECT c.name AS ColName, t.name AS TableName
FROM sys.columns c
    JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%YourKeyword%'


Best Wishes,

LadyinProgramming

Find stored procedure containing text in sql server

Use this query to find stored procedure containing text in sql server:

SELECT name
FROM   sys.procedures
WHERE  Object_definition(object_id) LIKE '%YourKeyword%'


Best Wishes,

LadyinProgramming