Thursday, January 17, 2013

Get and Set WaterMark Text of AJAX

Hii  ,I will tell You how can we get Watermark text of Ajax Tool through Javascript
This Can be done by setting Behaviour Id of Watermark Extneder


<asp:TextBox runat="server" ID="txtproId" CssClass="invisible"  />
                                                <cc1:TextBoxWatermarkExtender ID="wtmProjectName" runat="server" BehaviorID="projCatbehav" TargetControlID="txtProjectCategory"
                                                    WatermarkCssClass="watermarked" WatermarkText="Goldy" />



function validate() {

}

To get the Text 
var procat11= $find("projCatbehav").get_Text();
Note:-projCatbehav is an Behaviour Id

To Set the Text
$find("projCatbehav").set_Text("Please Type Here");



Saturday, July 28, 2012

Find Particular Column in a Database

Hi guys Now you can find the table name if you know the column name in a Database
Here we go
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%Fee%'
ORDER BY schema_name, table_name;

Note:-Fee is my column name


Thursday, May 24, 2012

TOO Many Arguments Specified Resolved

Heloo to all, Now guys i am going to tell you that how you can check your Sql datasource parameters.
when you pass parameters from .aspx page,mostly time you get an error

TOO MANY ARGUMENTS SPECIFIED

To check it you have to call updating method

protected void SqlDataSource2_Updating(object sender, SqlDataSourceCommandEventArgs e)
    {
     
        for (int i = 0; i < e.Command.Parameters.Count; i++)
        {
            Trace.Write(e.Command.Parameters[i].ParameterName);
            if (e.Command.Parameters[i].Value != null)
            {
                Trace.Write(e.Command.Parameters[i].Value.ToString());
            }
        }
    }


with this you can check each value by parameter wise

Monday, May 14, 2012

Retrieve only Time in sql

Hello to all Now i will tell you that how to fetch only time from GetDate() function

SELECT LTRIM(RIGHT(CONVERT(VARCHAR(20),  GetDate() , 100), 7))

Make checkbox checked,Unchecked according to status 0&1 at .aspx page

Hello to all Now I am going to tell you that How can You bind checkbox in datalist and make it Checked and unchecked in .aspx page itself. No Need to do code at .cs page


 <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource2">
                    <ItemTemplate>
                      
                                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("status").ToString() == "1" ? true : false %>' />
                           
                    </ItemTemplate>
                </asp:DataList>