<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Development - Web Development Tutorial for Developer&#039;s, Asp.net Tutorial, PHP Development, Wordpress Integration &#187; ASP.NET</title>
	<atom:link href="http://www.solutions4ever.net/category/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutions4ever.net</link>
	<description>Web Development Solutions Provider</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:11:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hide/Show input box value on focus</title>
		<link>http://www.solutions4ever.net/2010/11/hideshow-input-box-value-on-focus/</link>
		<comments>http://www.solutions4ever.net/2010/11/hideshow-input-box-value-on-focus/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 11:15:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=268</guid>
		<description><![CDATA[<p>For hiding the input box value on focus you just copy and pate the following code within you input box.</p>
<p>onfocus=&#8221;javascript: if(this.value==&#8217;Name&#8217;) { this.value=&#8221;;}&#8221;
onblur=&#8221;javascript: if(this.value==&#8221;) { this.value=&#8217;Name&#8217;; }&#8221;</p>
]]></description>
			<content:encoded><![CDATA[<p>For hiding the input box value on focus you just copy and pate the following code within you input box.</p>
<p>onfocus=&#8221;javascript: if(this.value==&#8217;Name&#8217;) { this.value=&#8221;;}&#8221;<br />
onblur=&#8221;javascript: if(this.value==&#8221;) { this.value=&#8217;Name&#8217;; }&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/11/hideshow-input-box-value-on-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find row index of gridview on RowCommand without CommandArgument</title>
		<link>http://www.solutions4ever.net/2010/10/find-row-index-of-gridview-on-rowcommand-without-commandargument/</link>
		<comments>http://www.solutions4ever.net/2010/10/find-row-index-of-gridview-on-rowcommand-without-commandargument/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 05:46:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=261</guid>
		<description><![CDATA[<p>Gridview has a template field with item linkbutton delete with CommandName now when user click on linkbutton then find the rowindex on Rowcommand event of gridview using C#.net</p>
<p></p>
<p>protected void grdtest1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == &#8220;DeleteRow&#8221;)
{
LinkButton gv = (LinkButton)e.CommandSource;
GridViewRow gvr = (GridViewRow)gv.Parent.Parent;
int rownum = gvr.RowIndex;
}
} </p>
]]></description>
			<content:encoded><![CDATA[<p><strong>Gridview has a template field with item linkbutton delete with CommandName now when user click on linkbutton then find the rowindex on Rowcommand event of gridview using C#.net</strong></p>
<p><br/><br/></p>
<p>protected void grdtest1_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
if (e.CommandName == &#8220;DeleteRow&#8221;)<br />
{<br />
LinkButton gv = (LinkButton)e.CommandSource;<br />
GridViewRow gvr = (GridViewRow)gv.Parent.Parent;<br />
int rownum = gvr.RowIndex;<br />
}<br />
} </p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/10/find-row-index-of-gridview-on-rowcommand-without-commandargument/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace enter key value from textbox using asp.net with c#.net and save in database</title>
		<link>http://www.solutions4ever.net/2010/10/replace-enter-key-value-from-textbox-using-asp-net-with-c-net-and-save-in-database/</link>
		<comments>http://www.solutions4ever.net/2010/10/replace-enter-key-value-from-textbox-using-asp-net-with-c-net-and-save-in-database/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 05:52:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=264</guid>
		<description><![CDATA[<p>Problem: when I wants save multiline textbox value in database using   asp.net with c#.net and show as it is its not happening &#8230;.
Actually the problem is when we enter the value in textbox and press enter key. value like this</p>
<p>this is jack 
web developer</p>
<p>it save in database but  ... <a href="http://www.solutions4ever.net/2010/10/replace-enter-key-value-from-textbox-using-asp-net-with-c-net-and-save-in-database/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p>Problem: when I wants save multiline textbox value in database using   asp.net with c#.net and show as it is its not happening &#8230;.<br />
Actually the problem is when we enter the value in textbox and press enter key. value like this</p>
<p>this is jack <br />
web developer</p>
<p>it save in database but when fetch value from database its showing in same line like this: this is jack web developer</p>
<p>solution: string txtvalue = mytextbox.Text.ToString().Replace(&quot;\r\n&quot;, &quot;<br />
&quot;);</p>
<p>and save it.<br />
Because enter key value is \r\n . and now it will show as u entered text</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/10/replace-enter-key-value-from-textbox-using-asp-net-with-c-net-and-save-in-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make PNG transparency work in Internet Explorer</title>
		<link>http://www.solutions4ever.net/2010/05/make-png-transparency-work-in-internet-explorer/</link>
		<comments>http://www.solutions4ever.net/2010/05/make-png-transparency-work-in-internet-explorer/#comments</comments>
		<pubDate>Fri, 28 May 2010 10:51:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=183</guid>
		<description><![CDATA[
<p>Create a container to store your image. In this case I use a &#60;div&#62;.
Create your &#60;div&#62; inside your &#60;body&#62;, just like this.</p>
<p>&#60;body&#62; &#60;div&#62;&#60;/div&#62; &#60;/body&#62;</p>
<p>Next, create a &#60;style&#62; if you dont have one. Make sure they are between your &#60;head&#62; &#60;/head&#62;. Put the following css inside.</p>
<p>&#60;style&#62;
body {background-color:#000}
div.flower {background:url(flower-transparent.png) no-repeat; height:100px; width:100px}
&#60;/style&#62;</p>
<p>The  ... <a href="http://www.solutions4ever.net/2010/05/make-png-transparency-work-in-internet-explorer/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<div id="TixyyLink">
<p>Create a container to store your image. In this case I use a &lt;div&gt;.<br />
Create your &lt;div&gt; inside your &lt;body&gt;, just like this.</p>
<p>&lt;body&gt; &lt;div&gt;&lt;/div&gt; &lt;/body&gt;</p>
<p>Next, create a &lt;style&gt; if you dont have one. Make sure they are between your &lt;head&gt; &lt;/head&gt;. Put the following css inside.</p>
<p>&lt;style&gt;<br />
body {background-color:#000}<br />
div.flower {background:url(flower-transparent.png) no-repeat; height:100px; width:100px}<br />
&lt;/style&gt;</p>
<p>The CSS codes above displays your PNG image in a &lt;div&gt;. Works fine for Mozilla Firefox, but not for Internet Explorer. To get it working cross browser, create another set of css just for Internet Explorer right below your &lt;style&gt; &lt;/style&gt;. Insert the following codes.</p>
<p>&lt;!–[if gte IE 5]&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
div.flower {<br />
background:none;<br />
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’flower.png’ ,sizingMethod=’crop’);<br />
}<br />
&lt;/style&gt;<br />
&lt;![endif]–&gt;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/05/make-png-transparency-work-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Declaring string arrays</title>
		<link>http://www.solutions4ever.net/2010/03/declaring-string-arrays/</link>
		<comments>http://www.solutions4ever.net/2010/03/declaring-string-arrays/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 06:16:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=161</guid>
		<description><![CDATA[<p>First, here we observe that there are some ways to declare and instantiate a string[] array local variable. They are all equivalent in the compiled code [see note], so choose the one you think is clearest to read.</p>
~~~ Program that initializes string arrays (C#) ~~~
 
class Program
{
    static void Main()
    {
  //  ... <a href="http://www.solutions4ever.net/2010/03/declaring-string-arrays/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p>First, here we observe that there are some ways to declare and instantiate a string[] array local variable. They are all equivalent in the compiled code [see note], so choose the one you think is clearest to read.</p>
<pre><strong>~~~ Program that initializes string arrays (C#) ~~~</strong></pre>
<pre> </pre>
<pre>class Program</pre>
<pre>{</pre>
<pre>    static void Main()</pre>
<pre>    {</pre>
<pre>  // String arrays with 3 elements:</pre>
<pre>string[] <strong>arr1</strong> = new string[] { "one", "two", "three" }; // A</pre>
<pre>string[] <strong>arr2</strong> = { "one", "two", "three" };              // B</pre>
<pre>string<strong> arr3</strong> = new string[] { "one", "two", "three" };  // C</pre>
<pre> </pre>
<pre> string[] <strong>arr4</strong> = new string[3]; // D</pre>
<pre>        arr4[0] = "one";</pre>
<pre>        arr4[1] = "two";</pre>
<pre>        arr4[2] = "three";</pre>
<pre>    }</pre>
<pre>}</pre>
<p><strong>Description.</strong> The above Main function shows four string[] arrays, each equal to the compiler. The biggest difference is that the first three arrays are declared on one line, while the fourth array is assigned in separate statements. The fourth array would permit you to test each value or insert logic as you assign it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/03/declaring-string-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TCPDate Server / Client</title>
		<link>http://www.solutions4ever.net/2010/02/tcpdate-server-client/</link>
		<comments>http://www.solutions4ever.net/2010/02/tcpdate-server-client/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 06:52:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=92</guid>
		<description><![CDATA[<p>This is the implementation of &#8220;System.Net.Sockets&#8221;. In this example we will learn how to use the &#8220;TCPListener&#8221; and &#8220;TCPClient&#8221; classes from the &#8220;System.Net.Sockets&#8221; namespace. </p>
<p>This example consists of two files. The &#8220;DateServer&#8221; class which uses the &#8220;TCPListener&#8221; class to accept requests from new clients. Once the client is connected with  ... <a href="http://www.solutions4ever.net/2010/02/tcpdate-server-client/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial; font-size: x-small;">This is the implementation of &#8220;System.Net.Sockets&#8221;. In this example we will learn how to use the &#8220;TCPListener&#8221; and &#8220;TCPClient&#8221; classes from the &#8220;System.Net.Sockets&#8221; namespace. </span></p>
<p><span style="font-family: Arial; font-size: x-small;">This example consists of two files. The &#8220;DateServer&#8221; class which uses the &#8220;TCPListener&#8221; class to accept requests from new clients. Once the client is connected with the server, the server will send it the the Current Date and Time and then disconnect it, and listen for more clients.<br />
The &#8220;DateClient&#8221; class uses the &#8216;TCPClient&#8221; class. It connects to the server on the specified port and send the clients name to the server upon connection.<br />
Once connected it receives the current Date Time from the server and then disconnects from the server.</p>
<p>Execution :<br />
1) Run the DateServer.exe first to start the server .(The server by default listens for connection on port 4554).<br />
2) Run the DateClient.exe which will connect to the server and get the current date time from it.</span></p>
<p><span style="font-size: x-small;">Code:<br />
1) <em>DateServer.cs :- The Date Time Server</em></span></p>
<div>
<pre><span style="font-family: Verdana; font-size: xx-small;">namespace SaurabhNet {
 using System;
 using System.Net.Sockets;
 using System.Net ;
 using System.Threading ;
 <span style="color: #0000cc;">//Import the necessary Namespaces</span>

 <span style="color: #0000cc;">//Class which shows the implementation of the TCP Date server</span>

 public class DateServer
 {
   private TCPListener myListener ;
   private int port = 4554 ;
   <span style="color: #0000cc;">//The constructor which make the TCPListener start listening on the
   //given port.
   //It also calls a Thread on the method StartListen(). </span>
   public DateServer()
   {
    try{
<span style="color: #0000cc;">//start listing on the given port</span>
  myListener = new TCPListener(port) ;
 myListener.Start();
 Console.WriteLine("Server Ready - Listining for new Connections ...") ;
<span style="color: #0000cc;">//start the thread which calls the method 'StartListen'</span>
 Thread th = new Thread(new ThreadStart(StartListen));
  th.Start() ;
 }
  catch(Exception e)
   {
 Console.WriteLine("An Exception Occured while Listing :"+e.ToString());
    }
    }

<span style="color: #0000cc;">//main entry point of the class</span>
 public static void Main(String[] argv)
 {
  DateServer dts = new DateServer();
 }
<span style="color: #0000cc;">//This method Accepts new connection and
    //First it receives the welcome massage from the client,
    //Then it sends the Current time to the Client.</span>
    public void StartListen()
 {
 while(true)
  {
<span style="color: #0000cc;">//Accept a new connection</span>
 Socket mySocket = myListener.Accept() ;
 if(mySocket.Connected)
 {
 Console.WriteLine("Client Connected!!") ;
<span style="color: #0000cc;">//make a byte array and receive data from the client </span>
 Byte[] receive = new Byte[64] ;
 int i=mySocket.Receive(receive,receive.Length,0) ;
  char[] unwanted = {' ',' ',' '};
 string rece = System.Text.Encoding.ASCII.GetString(receive);
   Console.WriteLine(rece.TrimEnd(unwanted)) ;
<span style="color: #0000cc;">//get the current date/time and convert it to string</span>
  DateTime now = DateTime.Now;
  String strDateLine ="Server: The Date/Time Now is: "
+ now.ToShortDateString()
  + " " + now.ToShortTimeString();
<span style="color: #0000cc;">// Convert to byte array and send</span>
  Byte[] byteDateLine=
Text.Encoding.ASCII.GetBytes(strDateLine.ToCharArray());
 mySocket.Send(byteDateLine,byteDateLine.Length,0);
				}
      }
    }
  }
} </span></pre>
<p> </p>
</div>
<p><span style="font-size: x-small;">2)<em> DateClient.cs:- The Date Time Client</em></span></p>
<div>
<pre><span style="font-family: Verdana; font-size: xx-small;">namespace SaurabhNet {
  using System ;
  using System.Net.Sockets ;
  using System.Net ;
  using System.Threading ;

  <span style="color: #0000cc;">//Class which shows the implementation of the TCP Date Client</span>
  public class DateClient
  {
    <span style="color: #0000cc;">//the needed member fields</span>
    private TCPClient tcpc;
    private string name ;
    private int port=4554 ;
    private bool readData=false ;

    <span style="color: #0000cc;">//Constructor which contains all the code for the client.
    //It connects to the server and sends the clients name,
    //Then it waits and receives the date from the server</span>
    public DateClient(string name)
    {
      <span style="color: #0000cc;">//a label</span>
      tryagain :
      this.name=name ;
      try
      {
      <span style="color: #0000cc;">//connect to the "localhost" at the give port
      //if you have some other server name then you can use that
     //instead of "localhost"</span>
      tcpc =new TCPClient("localhost",port) ;
      <span style="color: #0000cc;">//get a Network stream from the server</span>
      NetworkStream nts = tcpc.GetStream() ;
      <span style="color: #0000cc;">//if the stream is writiable then write to the server</span>
      if(nts.CanWrite)
      {
        string sender = "Hi Server I am "+name ;
 Byte[] sends =
 System.Text.Encoding.ASCII.GetBytes(sender.ToCharArray());
 nts.Write(sends,0,sends.Length) ;
<span style="color: #0000cc;">//flush to stream </span>
nts.Flush() ;

<span style="color: #0000cc;">//make a loop to wait until some data is read from
 the stream</span>
	while(!readData&amp;&amp;nts.CanRead)
	{
<span style="color: #0000cc;">//if data available then read from the stream</span>
  if(nts.DataAvailable)
      {
      byte[] rcd = new byte[128];
    int i=nts.Read( rcd,0,128);
string ree = System.Text.Encoding.ASCII.GetString(rcd);
 char[] unwanted = {' ',' ',' '};
  Console.WriteLine(ree.TrimEnd(unwanted)) ;
<span style="color: #0000cc;">//Exit the loop  </span>
  readData=true ;
 }
  }
}
catch(Exception e)
{
Console.WriteLine("Could not Connect to server because "+e.ToString());
<span style="color: #0000cc;">Here an exception can be cause if the client is started before starting
//the server.
//A good way to handle such exceptions and give the client
//a chance to re-try to connect to the server</span>
Console.Write("Do you want to try Again? [y/n]: ") ;
    char check = Console.ReadLine().ToChar();
if(check=='y'|| check=='Y')
goto tryagain ;
}
}

<span style="color: #0000cc;">//Main Entry point of the client class</span>
 public static void Main(string[] argv)
 {
<span style="color: #0000cc;">//check to see if the user has entered his name
 //if not ask him if he wants to enter his name.</span>
  if(argv.Length&lt;=0)
      {
 Console.WriteLine("Usage: DataClient ") ;
 Console.Write("Would You like to enter your name now [y/n] ?") ;
 char check = Console.ReadLine().ToChar();
 if(check=='y'|| check=='Y')
      {
  Console.Write("Please enter you name :") ;
 string newname=Console.ReadLine();
   DateClient dc = new DateClient(newname) ;
   Console.WriteLine("Disconnected!!") ;
  Console.ReadLine() ;
		}
      }
      else
      {
      DateClient dc = new DateClient(argv[0]) ;
      Console.WriteLine("Disconnected!!") ;
      Console.ReadLine() ;
      }
    }
  }
}</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/tcpdate-server-client/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP.NET 301 redirect</title>
		<link>http://www.solutions4ever.net/2010/02/asp-net-301-redirect/</link>
		<comments>http://www.solutions4ever.net/2010/02/asp-net-301-redirect/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 06:51:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=90</guid>
		<description><![CDATA[<p>When moving your pages from one place to another it is very tempting to handle old inlinks by creating a simple Response.Redirect( sNewPage, true );</p>
<p>This sure will work, but this type of redirect is a 302 and is meant for temporary relocations of pages. But your pages are permanently moved  ... <a href="http://www.solutions4ever.net/2010/02/asp-net-301-redirect/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p>When moving your pages from one place to another it is very tempting to handle old inlinks by creating a simple Response.Redirect( sNewPage, true );</p>
<p>This sure will work, but this type of redirect is a 302 and is meant for temporary relocations of pages. But your pages are permanently moved and therefore you should use a 301 Moved Permanently status code. This should preserve your search engine rankings for that particular page.</p>
<p>To solve it you could install some sort of redirect filter(ISAPI dll). I was looking into those type of solutions and found IISMods URL Rewrite Filter for IIS. </p>
<p>Such a solution is very flexible and since it is a IIS filter it is possible to rewrite URL:s for all kind of filetypes, not only for aspx pages but say images (ex http://www.solutions4ever.net/*.gif could be transferred to http://www.hello.com/test/*gif ).</p>
<p>It is however not possible for everyone to install a ISAPI filter on their website, therefore I here present a solution on how you can achieve 301 redirects with pure ASP.NET code instead.</p>
<p>  In your old page you can write code such as</p>
<p>private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
 Response.Status = &#8220;301 Moved Permanently&#8221;;<br />
 Response.AddHeader(&#8220;Location&#8221;,&#8221;http://www.solutions4ever.net&#8221;);<br />
}</p>
<p>For me who wanted to redirect all calls to http://solutions4ever.net/articles/articles27.aspx to http://www.solutions4ever.net/articles/articles27.aspx<span style="color: #000000;"> </span> took and didn&#8217;t have to think about pictures, cause they were &#8220;base&#8221; linked with the application took the idea one step further.</p>
<p>I created a new web application to install on kbmentor.aspcode.net. Basically it only contains a global.asax which handles Application_BeginRequest like this:</p>
<p>  protected void Application_BeginRequest(Object sender, EventArgs e)<br />
  {<br />
   string sOldPath = HttpContext.Current.Request.Path.ToLower();<br />
   </p>
<p>   string sPage = &#8220;http://www.solutions4ever.net/articles/&#8221; + sOldPath;<br />
   Response.Clear();<br />
   Response.Status = &#8220;301 Moved Permanently&#8221;;<br />
   Response.AddHeader(&#8220;Location&#8221;,sPage);<br />
   Response.End();<br />
  }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/asp-net-301-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# quations &#8211; answers</title>
		<link>http://www.solutions4ever.net/2010/02/c-quations-answers/</link>
		<comments>http://www.solutions4ever.net/2010/02/c-quations-answers/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 06:50:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=88</guid>
		<description><![CDATA[Good for preparation and general self-testing, but too specific for the actual job interview. This was sent in by a job applicant getting ready to step into the .NET field in India.

Are private class-level variables inherited? - Yes, but they are not accessible, so looking at it you can honestly  ... <a href="http://www.solutions4ever.net/2010/02/c-quations-answers/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<div>Good for preparation and general self-testing, but too specific for the actual job interview. This was sent in by a job applicant getting ready to step into the .NET field in India.</div>
<ol type="1">
<li><strong>Are private class-level variables inherited? </strong>- Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.</li>
<li><strong>Why does DllImport not work for me? </strong>- All methods marked with the DllImport attribute must be marked as public static extern.</li>
<li><strong>Why does my Windows application pop up a console window every time I run it? </strong>- Make sure that the target type set in the project properties setting is set to Windows Application, and not Console Application. If you’re using the command line, compile with /target:winexe, not /target:exe.</li>
<li><strong>Why do I get an error (CS1006) when trying to declare a method without specifying a return type? </strong>- If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following is an example: // This results in a CS1006 error public static staticMethod (mainStatic obj) // This will work as wanted public static void staticMethod (mainStatic obj)</li>
<li><strong>Why do I get a syntax error when trying to declare a variable called checked? </strong>- The word checked is a keyword in C#.</li>
<li><strong>Why do I get a security exception when I try to run my C# app? </strong>- Some security exceptions are thrown if you are working on a network share. There are some parts of the frameworks that will not run if being run off a share (roaming profile, mapped drives, etc.). To see if this is what’s happening, just move the executable over to your local drive and see if it runs without the exceptions. One of the common exceptions thrown under these conditions is System.Security.SecurityException. To get around this, you can change your security policy for the intranet zone, code group 1.2, (the zone that running off shared folders falls into) by using the caspol.exe tool.</li>
<li><strong>Why do I get a <em>CS5001: does not have an entry point defined</em> error when compiling? </strong>- The most common problem is that you used a lowercase ‘m’ when defining the Main method. The correct way to implement the entry point is as follows: class test { static void Main(string[] args) {} }</li>
<li><strong>What optimizations does the C# compiler perform when you use the /optimize+ compiler option? </strong>- The following is a response from a developer on the C# compiler team: We get rid of unused locals (i.e., locals that are never read, even if assigned). We get rid of unreachable code. We get rid of try-catch with an empty try. We get rid of try-finally with an empty try. We get rid of try-finally with an empty finally. We optimize branches over branches: gotoif A, lab1 goto lab2: lab1: turns into: gotoif !A, lab2 lab1: We optimize branches to ret, branches to next instruction, and branches to branches.</li>
<li><strong>What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)? </strong>- The syntax for calling another constructor is as follows: class B { B(int i) { } } class C : B { C() : base(5) // call base constructor B(5) { } C(int i) : this() // call C() { } public static void Main() {} }</li>
<li><strong>What is the equivalent to regsvr32 and regsvr32 /u a file in .NET development? </strong>- Try using RegAsm.exe. Search MSDN on <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp">Assembly Registration Tool</a>.</li>
<li><strong>What is the difference between a struct and a class in C#? </strong>- From language spec: The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes in several important ways; however, structs are value types rather than reference types, and inheritance is not supported for structs. Struct values are stored on the stack or in-line. Careful programmers can sometimes enhance performance through judicious use of structs. For example, the use of a struct rather than a class for a Point can make a large difference in the number of memory allocations performed at runtime. The program below creates and initializes an array of 100 points. With Point implemented as a class, 101 separate objects are instantiated-one for the array and one each for the 100 elements.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/c-quations-answers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dot Net Interview Quations 6</title>
		<link>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-6/</link>
		<comments>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-6/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 06:50:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=86</guid>
		<description><![CDATA[What is Serialization in .NET? 
Anwer1
The serialization is the process of converting the objects into stream of bytes.
they or used for transport the objects(via remoting) and persist objects(via files and databases)
<p>Answer2
When developing smaller applications that do not have a database (or other formal storage mechanism) or data that doesn’t need  ... <a href="http://www.solutions4ever.net/2010/02/dot-net-interview-quations-6/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<div><strong>What is Serialization in .NET? </strong><br />
Anwer1<br />
The serialization is the process of converting the objects into stream of bytes.<br />
they or used for transport the objects(via remoting) and persist objects(via files and databases)</div>
<p>Answer2<br />
When developing smaller applications that do not have a database (or other formal storage mechanism) or data that doesn’t need to be stored in a database (such as the state of a web application), you often still would like to save the data for later retrieval. There are many ways to do this, but many of them are subject to a lot of extra code (work) and extra time spent debugging. With .NET, there is now an easy way to add this functionality to your code with only a few lines of easily tested code. This easy way is called serialization.</p>
<p>Serialization is the process of storing an object, including all of its public and private fields, to a stream. Deserialization is the opposite – restoring an object’s field values from a stream. The stream is generally in the form of a FileStream, but does not have to be. It could be a memory stream or any other object that is of type IO.Stream. The format can be anything from XML to binary to SOAP.</p>
<div><strong>What’s the use of System.Diagnostics.Process class? </strong><br />
By using System.Diagnostics.Process class, we can provide access to the files which are presented in the local and remote system.<br />
Example: System.Diagnostics.Process(”c:\mlaks\example.txt”) — local file<br />
System.Diagnostics.Process(”http://www.mlaks.com\example.txt”) — remote file</div>
<div><strong>What are the authentication methods in .NET?</strong><br />
Abstract class: This class has abstract methods (no body). This class cannot be instantiated. One needs to provide the implementation of the methods by overriding them in the derived class. No Multiple Inheritance.<br />
Interfaces: Interface class contains all abstract methods which are public by default. All of these methods must be implemented in the derived class. One can inherit from from more than one interface thus provides for Multiple Inheritance.</div>
<div><strong>re-clarification of object based: </strong><br />
VB6 DOES support polymorphism and interface inheritance. It also supports the “Implements” keyword. What is not supported in vb6 is implementation inheritance.<br />
Also, from above, vb6 DOES “provides access to third-party controls like COM, DCOM ” That is not anything new in .NET.</div>
<div><strong>How to achieve Polymorphism in VB.Net? </strong><br />
We can achieve polymarphism in .Net i.e Compile time polymarphism and Runtime polymarphism. Compiletime Polymarphism achieved by method overloading. Runtime polymarphism achieved by Early Binding or Late Binding. Provide the function pointer to the object at compile time called as Early Binding.<br />
provide the function pointer to the object at runtime called as Late Binding<br />
class emp having the method display()<br />
class dept having the method display()</div>
<p>create objects as in the main function<br />
// Early binding<br />
dim obj as new emp<br />
dim ob as new dept</p>
<p>obj.display()-to call the display method of emp class<br />
ob.display-to call the display method of the dept class<br />
// Late binding</p>
<p>create object in the main class as<br />
object obj<br />
obj=new emp<br />
obj.display()-to call the display of emp class<br />
obj=new dept<br />
obj.display()-to call the display of dept class</p>
<div><strong>Difference between Class And Interface </strong><br />
Class is logical representation of object. It is collection of data and related sub procedures with defination.<br />
Interface is also a class containg methods which is not having any definations.<br />
Class does not support multiple inheritance. But interface can support.</div>
<div><strong>What doesu mean by .NET framework? </strong><br />
The .NET Framework is an environment for building, deploying, and running Web Services and other applications. It consists of three main parts: the Common Language Runtime, the Framework classes, and ASP.NET</div>
<div><strong>What is assembly? </strong><br />
It is a single deployable unit that contains all the information abt the implimentation of classes , stuctures and interfaces</div>
<div><strong>What is namespaces? </strong><br />
It is a logical group of related classes and interfaces and that can be used byany language targeting the .net framework.</div>
<div><span style="text-decoration: underline;">.NET framework programming interview questions </span><br />
<strong><br />
.NET framework overview</strong><br />
1. Has own class libraries. System is the main namespace and all other namespaces are subsets of this.<br />
2. It has CLR(Common language runtime, Common type system, common language specification)<br />
3. All the types are part of CTS and Object is the base class for all the types.<br />
4. If a language said to be .net complaint, it should be compatible with CTS and CLS.<br />
5. All the code compiled into an intermediate language by the .Net language compiler, which is nothing but an assembly.<br />
6. During runtime, JIT of CLR picks the IL code and converts into PE machine code and from there it processes the request.<br />
7. CTS, CLS, CLR<br />
8. Garbage Collection<br />
9. Dispose, finalize, suppress finalize, Idispose interface<br />
10. Assemblies, Namespace: Assembly is a collection of class/namespaces. An assembly contains Manifest, Metadata, Resource files, IL code<br />
11. Com interoperability, adding references, web references<br />
12. Database connectivity and providers</div>
<p>Application Domain<br />
1. Class modifiers: public, private, friend, protected, protected friend, mustinherit, NotInheritable<br />
2. Method modifiers: public, private<br />
3. Overridable<br />
4. Shadows<br />
5. Overloadable<br />
6. Overrides<br />
7. Overloads<br />
8. Set/Get Property<br />
9. IIF<br />
10. Inheritance<br />
11. Polymorphism<br />
12. Delegates<br />
13. Events<br />
14. Reflection<br />
15. Boxing<br />
16. UnBoxing</p>
<p>ASP.Net<br />
1. Web Controls: Data grid (templates, sorting, paging, bound columns, unbound columns, data binding), Data list, repeater controls<br />
2. HTML Controls<br />
3. Code behind pages, system.web.ui.page base class<br />
4. Web.config: App settings, identity (impersonate), authentication (windows, forms, anonymous, passport), authorization<br />
5. Databind.eval<br />
6. Trace, Debug<br />
7. Output cache<br />
8. Session management<br />
9. Application, Session<br />
10. Global.asax httpapplication<br />
11. User controls, custom controls, custom rendered controls (postback event, postdatachanged event) usercontrol is the base class<br />
12. Directives</p>
<p>ADO.Net<br />
1. Command object (ExecuteNonquery, ExecuteReader, ExecuteXMLReader, ExecuteScalar)<br />
2. DataAdapter object (Fill)<br />
3. Dataset (collection of tables)<br />
4. CommandBuiler object<br />
5. Transaction Object<br />
6. Isolation levels</p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "pub-1795426627440279"; /* Solutions4ever_middler_link */ google_ad_slot = "8169630353"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><script type="text/javascript">// <![CDATA[
 google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);
// ]]&gt;</script><ins></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dot Net Interview Quations 5</title>
		<link>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-5/</link>
		<comments>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-5/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 06:48:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=84</guid>
		<description><![CDATA[I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is too time-consuming with Graphics objects. Can I automate this? 
Yes, the code</p>
<p>System.Drawing.Graphics canvas = new System.Drawing.Graphics();
try
{
//some code
}
finally
canvas.Dispose();</p>
<p>is functionally equivalent to</p>
<p>using (System.Drawing.Graphics canvas = new System.Drawing.Graphics())
{
//some code
} //canvas.Dispose() gets called automatically</p>
How do  ... <a href="http://www.solutions4ever.net/2010/02/dot-net-interview-quations-5/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<div><strong>I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is too time-consuming with Graphics objects. Can I automate this? </strong><br />
Yes, the code</p>
<p>System.Drawing.Graphics canvas = new System.Drawing.Graphics();<br />
try<br />
{<br />
//some code<br />
}<br />
finally<br />
canvas.Dispose();</p>
<p>is functionally equivalent to</p>
<p>using (System.Drawing.Graphics canvas = new System.Drawing.Graphics())<br />
{<br />
//some code<br />
} //canvas.Dispose() gets called automatically</p></div>
<div><strong>How do you trigger the Paint event in System.Drawing? </strong><br />
Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint.</div>
<div><strong>With these events, why wouldn’t Microsoft combine Invalidate and Paint, so that you wouldn’t have to tell it to repaint, and then to force it to repaint? </strong><br />
Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background.</div>
<div><strong>How can you assign an RGB color to a System.Drawing.Color object? </strong><br />
Call the static method FromArgb of this class and pass it the RGB values.</div>
<div><strong>What class does Icon derive from? Isn’t it just a Bitmap with a wrapper name around it?</strong><br />
No, Icon lives in System.Drawing namespace. It’s not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object.</div>
<div><strong>Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically? </strong><br />
By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a warning sign in it.</div>
<div><strong>When displaying fonts, what’s the difference between pixels, points and ems? </strong><br />
A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user’s settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M.</div>
<div><strong>What is the difference between VB 6 and VB.NET? </strong><br />
Answer1<br />
VB</p>
<p>1,Object-based Language<br />
2,Doesnot support Threading<br />
3,Not powerful Exception handling mechanism<br />
4,Doesnot having support for the console based applications<br />
5,Cannot use more than one version of com objects in vb application called DLL error<br />
6,Doesnot support for the Disconnected data source.</p>
<p>VB.Net</p>
<p>1,Object-oriented Language<br />
2,supports Threading<br />
3,powerful Exception handling mechanism<br />
4,having support for the console based applications<br />
5,More than one version of dll is supported<br />
6,supports the Disconnected data source by using Dataset class</p>
<p>Answer2<br />
VB:<br />
1. Object-based language<br />
2. Does not support inheritance<br />
3. ADO.Net does not give support for disconnected data architecture<br />
4. No interoperability function<br />
5. No support for threading</p>
<p>VB.Net<br />
1. Object-Oriented Programming lanugage<br />
2. ADO.Net gives support for disconnected data architecture<br />
3. It provides interoperability<br />
4. It uses managed code<br />
5. supports threading<br />
6. provides access to third-party controls like COM, DCOM</p>
<p>Answer2<br />
1.The concept of the complete flow of execution of a program from start to finish: Visual Basic hides this aspect of programs from you, so that the only elements of a Visual Basic program you code are the event handlers and any methods in class modules. C# makes the complete program available to you as source code. The reason for this has to do with the fact that C# can be seen, philosophically, as next-generation C++. The roots of C++ go back to the 1960s and predate windowed user interfaces and sophisticated operating systems. C++ evolved as a low-level, closeto- the-machine, all-purpose language. To write GUI applications with C++ meant that you had to invoke the system calls to create and interact with the windowed forms. C# has been designed to build on this tradition while simplifying and modernizing C++, to combine the low-level performance benefits of C++ with the ease of coding in Visual Basic. Visual Basic, on the other hand, is designed specifically for rapid application development of Windows GUI applications. For this reason, in Visual Basic all the GUI boilerplate code is hidden, and all the Visual Basic programmer implements are the event handlers. In C# on the other hand, this boilerplate code is exposed as part of your source code.<br />
2. Classes and inheritance: C# is a genuine object-oriented language, unlike Visual Basic, requiring all code to be a part of a class. It also includes extensive support for implementation inheritance. Indeed, most well-designed C# programs will be very much designed around this form of inheritance, which is completely absent in Visual Basic.</p></div>
<div><strong>What are the authentication methods in .NET?</strong><strong><br />
</strong>There are 4 types of authentications.<br />
1.WINDOWS AUTHENTICATION<br />
2.FORMS AUTHENTICATION<br />
3.PASSPORT AUTHENTICATION<br />
4.NONE/CUSTOM AUTHENTICATION</p>
<p>The authentication option for the ASP.NET application is specified by using the tag in the Web.config file, as shown below:<br />
other authentication options<br />
1. WINDOWS AUTHENTICATION Schemes<br />
I. Integrated Windows authentication<br />
II. Basic and basic with SSL authentication<br />
III. Digest authentication<br />
IV. Client Certificate authentication</p>
<p>2. FORMS AUTHENTICATION<br />
You, as a Web application developer, are supposed to develop the Web page and authenticate the user by checking the provided user ID and password against some user database</p>
<p>3.PASSPORT AUTHENTICATION<br />
A centralized service provided by Microsoft, offers a single logon point for clients. Unauthenticated users are redirected to the Passport site</p>
<p>4 NONE/CUSTOM AUTHENTICATION:<br />
If we don’t want ASP.NET to perform any authentication, we can set the authentication mode to “none”. The reason behind this decision could be: We don’t want to authenticate our users, and our Web site is open for all to use. We want to provide our own custom authentication</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/dot-net-interview-quations-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

