Wednesday, July 8, 2009

Find the SQL Server CD key Installed in your PC Using SQL command

USE master
EXEC xp_regread 'HKEY_LOCAL_MACHINE',
                'SOFTWARE\Microsoft\Microsoft SQL Server\80\registration', 
                 'CD_KEY'

Tuesday, July 7, 2009

Selecting unique node in a RSS feed base on user selection using c# asp.net

Selecting unique node in a RSS feed base on user selection using  c# asp.net

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default10.aspx.cs" Inherits="Default10" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:GridView ID="bank" Runat="server" DataSourceID="xds" AutoGenerateColumns="false" AllowPaging="True"  >
<Columns>

<asp:TemplateField>   
<ItemTemplate>       
<%# Container.DataItemIndex + 1 %>   
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
       <a href='Default10.aspx?url1=<%# Container.DataItemIndex + 1 %>'  >
          <%#XPath("title")%></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:XmlDataSource ID="xds" Runat="server" DataFile="http://rss.news.yahoo.com/rss/topstories"
>
</asp:XmlDataSource>
   
    </div>
    </form>
</body>
</html>

code behind

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default10 : System.Web.UI.Page
{
    string strURL;
    protected void Page_Load(object sender, EventArgs e)
    {
       // Response.Write(Request["url1"].ToString());

        if (Request["url1"] == null)
        {
            xds.XPath = "rss/channel/item [position()>=0]";
            //strURL = "1";
        }
        else
        {
            //xds.XPath = "rss/channel/item [position()=" + Request["url"] + "]";
            strURL = Request["url1"];
            xds.XPath = "rss/channel/item [position()=" + strURL + "]";
        }

       

    }
}

Add items in menu by role with fine cut - JD Edwards E1

Master view ->click on fine cut-> click on blank space and select view by role-> select the role

and add menu item -> after that agaion change the role to admin-> click on fine cut

RSS feed particular Item display in a gridview

<div>

<asp:GridView ID="bank" Runat="server" DataSourceID="xds" AutoGenerateColumns="False" AllowPaging="True" >

<

Columns>

<

asp:TemplateField>

<

ItemTemplate>

<asp:HyperLink ID="HyperLink1" Runat="server" Text='<%# XPath("title") %>' NavigateUrl='<%# XPath("link") %>'

Target="_blank" Font-Names="Verdana" Font-Size="X-Small">

</asp:HyperLink>

</

ItemTemplate>

</

asp:TemplateField>

</

Columns>

</

asp:GridView>

<

asp:XmlDataSource ID="xds" Runat="server" DataFile="http://rss.news.yahoo.com/rss/topstories"

XPath

="rss/channel/item [position()=2]">

</

asp:XmlDataSource>

</div>

Thursday, July 2, 2009

Compiler Error CS1705

Compiler Error CS1705

Auto Page refresh Sample Using C#, Ajax

Auto Page refresh Sample Using  C#, Ajax
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="autoreferesh.aspx.cs" Inherits="autoreferesh" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
     <asp:Label ID="Label2" runat="server" Text="This is Time, When The Full Page Load :" Font-Bold="true"></asp:Label>&nbsp;
     <asp:Label ID="MyLabel" runat="server"></asp:Label><br /><br />       
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="30000">
            </asp:Timer>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>
            <ContentTemplate>
                <asp:Label ID="Label3" runat="server" Text="This is The Time when Page will Referesh :" Font-Bold="true"></asp:Label>&nbsp;
                <asp:Label ID="Label1" runat="server" Text="Page not refreshed yet."></asp:Label><br />
                <asp:Label ID="Label4" runat="server" Text="(Page Will Referesh after Every 30 Sec)" Font-Bold="true"></asp:Label>&nbsp;
                <br /><br />
            </ContentTemplate>
        </asp:UpdatePanel>     
    </form>
</body>
</html>

code behind

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class autoreferesh : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MyLabel.Text = System.DateTime.Now.ToString();
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {

        Label1.Text = "Page Refreshed at: " + DateTime.Now.ToLongTimeString();

    }


}

Monday, June 29, 2009

HighOnCoding: Get high on ASP.NET articles, videos, podcasts and more!

HighOnCoding: Get high on ASP.NET articles, videos, podcasts and more!

Friday, June 26, 2009

Quotation in where condition sql-server

quotation in where condition sql-server

SELECT * FROM zzzzz WHERE zzzz = 'ZZzZ'cccc' change it
to SELECT * FROM zzzzz WHERE zzzz = 'ZZzZ''cccc'

Windows 7 Upgrade

Windows 7 is the easiest, fastest, and most engaging version of Windows yet. Better ways to find and manage files, like Jump Lists and improved taskbar previews, help you speed through everyday tasks. Faster and more reliable performance means your PC just works the way you want it to. And great features like Windows Media Center and Windows Touch make new things possible. Get to know Windows 7, and see how it can simplify just about everything you do with your PC.

Windows 7 will be available on October 22. It includes tons of little refinements—
and a few big ones—many suggested by you. The result? Everyday computing is
faster, simpler, easier.
Order Now Your Upgrade Version Save more then $100.

Windows7 Home Premium Upgrade

Windows7 Professional Upgrade

Thursday, June 25, 2009

Make ASP.NET Speak Typed Text

Make ASP.NET Speak Typed Text

Wednesday, June 24, 2009

Twitter asp.net 2.0, C# sample

I created following application to post in Twitter by using twitter apis..in asp.net 2.0, C#
 
 
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml" >

<

head runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<div>

<table style="width: 50%" align="center">

<tr>

<td>

</td>

<td>

</td>

<td>

</td>

</tr>

<tr>

<td align="right">

<asp:Label ID="Label2" runat="server" Text="User Id:"></asp:Label></td>

<td>

<asp:TextBox ID="txtusrid" runat="server" Width="144px"></asp:TextBox>

</td>

<td>

</td>

</tr>

<tr>

<td align="right">

<asp:Label ID="Label3" runat="server" Text="Password:"></asp:Label></td>

<td>

<asp:TextBox ID="txtpass" runat="server" TextMode="Password"></asp:TextBox></td>

<td>

</td>

</tr>

<tr>

<td align="right" style="height: 40px">

<asp:Label ID="Label1" runat="server" Text="Messages:"></asp:Label></td>

<td style="height: 40px">

<asp:TextBox ID="txtmessage" runat="server" TextMode="MultiLine" Width="259px" Height="99px"></asp:TextBox>

</td>

<td style="height: 40px">

</td>

</tr>

<tr>

<td style="height: 21px">

</td>

<td style="height: 21px">

<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />

<asp:Label ID="Label4" runat="server" Width="126px"></asp:Label></td>

<td style="height: 21px">

</td>

</tr>

</table>

</div>

</form>

</

body>
</
html>
 
Code behind

using

System;

using

System.Net;

using

System.Web;

using

System.IO;

public

partial class Default5 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

public void SubmitUserMsg(string username, string passwd, string txttweet)

{

string user = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username + ":" + passwd));

byte[] bytes = System.Text.Encoding.ASCII.GetBytes("status=" + txttweet);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://twitter.com/statuses/update.xml");

request.Method =

"POST";

request.ServicePoint.Expect100Continue = false;

request.Headers.Add(

"Authorization", "Basic " + user);

request.ContentType =

"application/x-www-form-urlencoded";

request.ContentLength = bytes.Length;

Stream reqStream = request.GetRequestStream();

reqStream.Write(bytes, 0, bytes.Length);

reqStream.Close();

Label4.Text =

"Message Posted";

}

protected void Button1_Click(object sender, EventArgs e)

{

SubmitUserMsg(txtusrid.Text, txtpass.Text, txtmessage.Text);

}

}

Tuesday, June 23, 2009

Error: Sys.WebForms.PageRequestManagerParserErrorException:

Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

change this <asp:ScriptManager ID="ScriptManager1" runat="server" />
to this <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false" />
this may fix your problem

HTML Editor ajax toolkit 3.5 vs 2008 Sample

Working sample for HTML Editor ajax toolkit 3.5 VS 2008 Sample ..Rich textbox sample...
 
 
 
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" ValidateRequest="false" Trace="false"%>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<%

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="HTMLEditor" %>

<

html xmlns="http://www.w3.org/1999/xhtml">

<

head runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<

div>

<asp:ScriptManager ID="ScriptManager1" runat="server" />

<script type="text/javascript">

</script>

<asp:UpdatePanel ID="updatePanel1" runat="server">

<ContentTemplate>

<HTMLEditor:Editor runat="server" Id="editor" Height="300px" AutoFocus="true" Width="100%" />

<br />

<asp:Button runat="server" Text="Submit content" ID="submit"

onclick="submit_Click" />

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

</

body>

</

html>

Monday, June 22, 2009

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. error

getting error
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
 
 
change:
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />
 
to: <asp:ScriptManager ID="ScriptManager1" runat="server" />

 

Encrypting the Web.Config File -- Visual Studio Magazine

Encrypting the Web.Config File -- Visual Studio Magazine