Tuesday, December 11, 2007

How To Find What Are All The Tables Available In Particular Schema In SQL SEREVER

Query To List All The Tables In a Particular Schema

Query

SELECT * FROM INFORMATION_SCHEMA.TABLES


Description
This Query List All The Tables In a Particular Schema(Database).


For Example

If You Are in the Pubs Schema(Database) In SQL SERVER,This Query List All The Tables available within the particular Schema including systable and user table

Query To List All The Columns Available In A Particular Schema


Query

SELECT * FROM INFORMATION_SCHEMA.COLUMNS


Description

This Query List All The Columns Available In A Particular Schema(Database)


For Example
If You Are in the Pubs Schema(Database) In SQL SERVER, This Query List All The Columns available within the particular Schema

Query To List All The Users Tables In a Particular Schema


Query

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME


Description

This Query List All The Users Tables In a Particular Schema(Database).

For Example
If You Are in the Pubs Schema(Database) In SQL SERVER, This Query List All The Users Tables available within the particular Schema

Query To List All The Columns Available In A Particular Schema


Query

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'AUTHORS'


Description
This Query List All The Columns Available In A Particular Schema(Database) for the Particular Table Authors

To Find The Primary Key Of The Table.


Syntax:


SP_PKEYS YourTableName


Description

This System Procedure Returns the Primary Key Reference Of The Particular Table In That Schema(Database).

Example: SP_PKEYS
AUTHORS

Note:Giving the tablename within the single quotes is not mandatory

To Find The Foreign Key Of The Table.

Syntax:


SP_FKEYS YourTableName


Description

This System Procedure Returns the Foreign Key Reference Of The Particular Table In That Schema(Database).

Example: SP_FKEYS
AUTHORS
Note: Giving the tablename within the single quotes is not mandatory

Tuesday, November 27, 2007

Oracle Find or Counts Number Of Row(s) And Column(s) In A Table

select count(*) from TableName // To Count The Number of Row(s) in a Particular table

Ex: Select Count(*) from emp;

select count(*) from user_tab_columns where table_name='TABLENAME';

// To Count The Number of Column(s) in a Particular table,

Note :TABLENAME Should be UPPERCASE Letter

Ex: Select  count(*) from user_tab_columns where table_name = 'EMP'

Friday, November 2, 2007

Dynamically Writing into Web.config File

Inline
    XmlDocument xDoc = new XmlDocument(); // Gobal Declaration
string Path; // Gobal Declaration
int i; // Gobal Declaration
protected void Page_Load(object sender, EventArgs e)
{
i = Convert.ToInt32(ConfigurationManager.AppSettings["Test"].ToString());
}
protected void bt1_Click(object sender, EventArgs e)
{
Path = Server.MapPath("~/web.config");
xDoc.Load(Path);
XmlNodeList NodeList = xDoc.GetElementsByTagName("appSettings");
XmlNodeList tNodeList = NodeList[0].ChildNodes;
XmlAttributeCollection xAttColl = tNodeList[0].Attributes;
xAttColl[0].InnerXml = "Test";
xAttColl[1].InnerXml = Convert.ToString(i + 1);
xDoc.Save(Path);
Response.Write(ConfigurationManager.AppSettings["Test"].ToString());
}

Web.Config

<configuration>

<appSettings>

<add key="Test" value="0" /> <!-- Add This In Your WebConfig File -->

</appSettings>

</configuration>

Friday, October 19, 2007

Solution For Sys.WebForms.PageRequestManagerTimeoutException

< asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeOut="300" >

</
asp:ScriptManager>

By Default AsyncPostBackTimeOut Property Value's 90 sec

Ajax UpdatePanal Custom Error Handling

Put This Code Within Inline Form Tag,
Note:Dont Put This JavaScript As a Seperate js File in your project,
use within a form tag

<form id="form1" runat="server">
<script language="javascript" type="text/javascript">


function pageLoad(sender, args)
{

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);

}

function beginRequest(sender, args)
{

.
.
.


}

function endRequest(sender, args)
{

var e = args.get_error();

if (e != null)
{
args.set_errorHandled(true);
alert('Custom Error');
}

}
</script>
</form>