Archive for November, 2008
Get User Control Value inside .ASPX page
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 [...]
search record from table at given date
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′))
remove any new line charactor from value of column
update emp set name=replace(name,char(10),”) where
charindex(char(10),name)>0
remove any space from any value of column
update emp set name=replace(name,’ ‘,”) where charindex(‘
‘,name)>0
checking space or any charactor in value in any column
select name from emp where charindex(‘ ‘,name)>0
Read Full Post | Make a Comment ( None so far )

