Archive for November, 2008

Get User Control Value inside .ASPX page

Posted on November 20, 2008. Filed under: Asp.net |

usercontrol page———
<%@ Control Language=”C#” AutoEventWireup=”true”
CodeFile=”header.ascx.cs” Inherits=”UserControl_header” %>
<asp:TextBox ID=”searchtext” runat=server Text=”what r u
want??”></asp:TextBox>
<asp:Button ID=”btnsearch” Text=search runat=server
OnClientClick=”retrun submitvalue()”/>
<asp:Label ID=”lbltext” runat=server></asp:Label>
on aspx pages—————–
<uc1:header ID=”header1″ runat=”server”  />
incode berhind pages———–
protected void Page_Load(object sender, EventArgs e)
{
UserControl huser = header1 as UserControl;
searchlog(ref huser, “text for search”);
}
void searchlog(ref UserControl hd, string text)
{
Label lb = (Label)hd.FindControl(“lbltext”);
TextBox txtbox = (TextBox)hd.FindControl(“searchtext”);
//here i assign text to usercontrol [...]

Read Full Post | Make a Comment ( 1 so far )

search record from table at given date

Posted on November 20, 2008. Filed under: Sql Server |

you pass date as varchar type and mm/dd/yyyy format
select * from emp where (createddate>’11/15/2008′ and
createddate<DATEADD(day,1, ‘11/15/2008′))

Read Full Post | Make a Comment ( 1 so far )

remove any new line charactor from value of column

Posted on November 20, 2008. Filed under: Sql Server |

update emp set name=replace(name,char(10),”) where
charindex(char(10),name)>0

Read Full Post | Make a Comment ( None so far )

remove any space from any value of column

Posted on November 20, 2008. Filed under: Asp.net |

update emp set name=replace(name,’ ‘,”) where charindex(‘
‘,name)>0

Read Full Post | Make a Comment ( None so far )

checking space or any charactor in value in any column

Posted on November 20, 2008. Filed under: Sql Server |

select name from emp where charindex(‘ ‘,name)>0

Read Full Post | Make a Comment ( None so far )

    About

    Hi,I am Suresh Sharma from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...