Introduction : In this article i will show how to redirect one website to another website . Many times we require that some one visit www.xyz.com then he should be redirect to another site for that you need add peace of java-script code and it automatically redirect to another site .
Introduction : In this article i will show you how to bind Radiobuttonlist in asp.net c# .Radiobuttonlist control is group of Radiobutton.Many time we require to bind the data in RadioButtonList using database sql server in asp.net . I have here provided complete Html code and Code behind code for binding RadioButtonList In Asp.net c# .Following are my simple code .
Introduction : In this article i will show you how you can add html code in Blogger .sometimes we require to display html code in blog too. To add Html code you need to follow just some steps then html code will be able to display in blog .
Many time we require to bind the data in checkboxlist using database sql server in asp.net . I have here provided complete Html code and Code behind code for binding CheckBoxList In Asp.net c# .Following are my simple code .
In this article i will show how to fill dataset from database sql server using c# language .For this i have created common methodh in which you have just pass the query and it automatically return the filled dataset .GetDataSet function contains the easy code to fill the dataset .
Calling the method :
DataSet Ds = GetDataSet("Select * from Tablename");
Method to bind dataset :
private DataSet GetDataSet(string Query)
{
DataSet Ds = new DataSet();
try
{
string strCon =""; // set connetion string here ..
SqlConnection Con = new SqlConnection(strCon);
SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
Da.Fill(Ds);
}
catch (Exception)
{
}
return Ds;
}
DateTime Format in GridView ItemTemplate In Asp.net C#
To format DateTime in GridView In ItemTemplate we have to pass format in eval or bind . There are many format available for the
DateTime .In this article i have given some example that how to format datetime and at end i have listed the datetime format
used in gridview .
Following are the examples of ItemTemplate where format used for datetime .
Find all references Of Object Table , Stored Procedures, Scalar function In sql Server
Following is the query by which you can get all references of object Like Table , Stored procedures ,Scalar function ..etc In Scalar function ,Trigger ,View ,stored procedure ..etc.
Many times we require that find all stored procedures that reference a given table .
By Following to search all objects in a database containing a certain string .
SELECT DISTINCT o.name AS ObjectName,
CASE o.xtype
WHEN 'C' THEN 'CHECK constraint'
WHEN 'D' THEN 'Default or DEFAULT constraint'
WHEN 'F' THEN 'FOREIGN KEY constraint'
WHEN 'FN' THEN 'Scalar function'
WHEN 'IF' THEN 'In-lined table-function'
WHEN 'K' THEN 'PRIMARY KEY or UNIQUE constraint'
WHEN 'L' THEN 'Log'
WHEN 'P' THEN 'Stored procedure'
WHEN 'R' THEN 'Rule'
WHEN 'RF' THEN 'Replication filter stored procedure'
WHEN 'S' THEN 'System table'
WHEN 'TF' THEN 'Table function'
WHEN 'TR' THEN 'Trigger'
WHEN 'U' THEN 'User table'
WHEN 'V' THEN 'View'
WHEN 'X' THEN 'Extended stored procedure'
ELSE o.xtype
END AS ObjectType,
ISNULL( p.Name, '[db]') AS Location
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
LEFT JOIN sysobjects p ON o.Parent_obj=p.id
WHERE c.text LIKE '%any text to search for%'
ORDER BY Location, ObjectName
If pass table object name then it show all references table in Stored procedures ,Scalar function ..etc .
If pass Stored procedure object name then it show all references Stored procedures in Stored Procedures ..etc .