Posts

Showing posts from February, 2012

How to get Table structure/Column information using SQL Query

There are different ways to fetch database 'Tables' or 'Views' structure INFORMATION_SCHEMA views: Microsoft has introduced 20 different views to fetch helpful database information as part of SQL Server database 2005 and onward. We will use 'columns' view to fetch table structure information In my openion,  this is the easiest way to fetch table structure information e.g., column name, data type, size, isnullable, table schema etc. to fetch table structure select * from INFORMATION_SCHEMA.columns where TABLE_NAME = 'tablename' or select column_name, data_type, is_nullable, character_maximum_length from INFORMATION_SCHEMA.columns where TABLE_NAME = 'tablename' using database name as prefix select *  from database. INFORMATION_SCHEMA.columns where TABLE_NAME = 'tablename' ----------------------------------- syscolumns & systypes: Getting columns and other structural information of a table select name ,...

Accessing HttpContext within Class Library ( Business Object) VB.Net

Accessing HttpContext within Class Library ( Business Object) VB.Net Add System.Web as a reference to the class library. Right click class library and then Add reference and from .Net select System.Web to add

Using Request.Url in Class Library ( Business Object) Vb.Net

Using Request.Url in Class Library ( Business Object) Vb.Net Dim m_MapPath As String = System.Web.HttpContext.Current.Request.Url.Scheme + Uri.SchemeDelimiter + System.Web.HttpContext.Current.Request.Url.Authority

Using ResolveUrl in Class Library ( Business object) VB.Net

Using ResolveUrl in Class Library ( Business object) VB.Net Dim page As System.Web.UI.Page = System.Web.HttpContext.Current.Handler Dim m_ImagePath As String =  page.ResolveUrl(WebConfigurationManager.AppSettings("ImagePath").ToString())