<feed version="0.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://purl.org/atom/ns#" xml:lang="en-US"><title>Sandesh Meda</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/default.aspx" /><tagline type="text/html">Blogging on .NET, SQL Server and Sharepoint Technologies</tagline><id>http://www.dotnetjunkies.com/WebLog/sandeshmeda/default.aspx</id><author><url>http://www.dotnetjunkies.com/WebLog/sandeshmeda/default.aspx</url></author><generator url="http://communityserver.org" version="1.0.1.50214">Community Server</generator><modified>2005-02-12T21:08:00Z</modified><entry><title>Clearing Recent Projects list in Visual Studio 2005</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2007/02/20/199395.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:199395</id><created>2007-02-20T06:51:00Z</created><content type="text/html" mode="escaped">If you had a list of projects listed on the Visual Studio 2005 Home page's Recent Projects section and wanted to clear any of these items, there is not a way to do it using the IDE.&lt;br&gt;&lt;br&gt;You will need to go to the registry (Start-&amp;gt;Run-&amp;gt;regedit) and remove entries from:&lt;br&gt;&lt;br&gt;HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=199395" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=199395</wfw:commentRss></entry><entry><title>Binding a datarow array to a gridview</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2007/02/15/196674.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:196674</id><created>2007-02-15T02:49:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;It's a common programming technique to use a dataset as a datasource to a grid control. But, if you have a datarow array that is a result of a maybe a SELECT, how would you bind it to a grid?&lt;BR&gt;&lt;BR&gt;This is possible by creating a datatable and looping through the datarow array object to populate the datatable. The code is as below:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/P&gt;&lt;FONT&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT&gt;DataRow&lt;/FONT&gt;&lt;FONT&gt;[] drArray;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;//sb is a stringbuilder that filters the XML. ex: " ID = 100 "&lt;/P&gt;
&lt;P&gt;drArray = dsXML.Tables[0].Select(sb.ToString()); &lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT&gt;DataTable&lt;/FONT&gt;&lt;FONT&gt; dtTable = dsXML.Tables[0].Clone();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT&gt;foreach&lt;/FONT&gt;&lt;FONT&gt; (&lt;/FONT&gt;&lt;FONT&gt;DataRow&lt;/FONT&gt;&lt;FONT&gt; dr &lt;/FONT&gt;&lt;FONT&gt;in&lt;/FONT&gt;&lt;FONT&gt; drArray)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;dtTable.ImportRow(dr);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;GridView1.DataSource = dtTable;&lt;/P&gt;
&lt;P&gt;GridView1.DataBind();&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=196674" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=196674</wfw:commentRss></entry><entry><title>XPath and .NET</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2007/02/12/194980.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:194980</id><created>2007-02-12T02:42:00Z</created><content type="text/html" mode="escaped">I had a XML file that had details of all the events that were going to be held. I had to display in a Web control, all the events that occured in the future. This task was accomplished using the XPath and XPathNodeIterator object in the System.XML.XPath namespace.

Here's the sample XML file:
&lt;code&gt;


	
		184
		Content 
		Title
		
			
				Event 1 Title 
				2007-02-22
			
		
	
	
		189 
		Content 
		
			
				Event 2 Title 
				2007-02-11
			
		
	


&lt;/code&gt;

Here's the code that creates a XPathNodeIterator object that has a list of all Event IDs.

&lt;code&gt;
    private void ShowEvents()
    {
        XPathDocument xDoc = new XPathDocument(Server.MapPath("Test.xml"));
        XPathNavigator xNav = xDoc.CreateNavigator();
        string strToday = DateTime.Now.ToString("yyyy-MM-dd");

	//The Start Date in the XML is in the yyyy-MM-dd format. The translate function in XPath purges the hyphens and
	//and a numerical comparison between dates is made. 
	//This was done because date comparison is not supported in XPath 1.0

        string strXPath = "/Collection/Content/Html/root[translate(StartDate,'-','') &gt; \"" + strToday.Replace("-","")  + "\"]/../../ID";
        XPathNodeIterator xIter = xNav.Select(strXPath);
        this.Label1.Text = strXPath;

        while (xIter.MoveNext())
        {
            //xIter.Current.Name has the name of the entity (In this case, it displays "ID")
            //xIter.Current.Value has the value of the "ID"
        }
    }
&lt;/code&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=194980" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=194980</wfw:commentRss></entry><entry><title>Overloading Webmethods</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2007/02/01/191012.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:191012</id><created>2007-02-01T05:33:00Z</created><content type="text/html" mode="escaped">By default, .NET does not allow you to overload WebMethods by specifying the same method name and changing the parameter list. Instead, Ansil discusses a way of doing this by specifying the MessageName property of the web method.&lt;br&gt;&lt;br&gt;http://www.codeproject.com/soap/RefAndOL.asp&lt;br&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=191012" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=191012</wfw:commentRss></entry><entry><title>How to report off of a ADO.NET dataset in SQL Reporting Services 2005</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2007/01/18/188024.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:188024</id><created>2007-01-18T02:13:00Z</created><content type="text/html" mode="escaped">The standard data sources that SRS supports are the SQL Server, XML, Oracle and ODBC. However, there is a way to have the report use a ADO.NET dataset as its data source. Here are some articles:&lt;br&gt;&lt;br&gt;http://prologika.com/CS/blogs/blog/archive/2005/11/20/695.aspx&lt;br&gt;&lt;br&gt;http://msdn2.microsoft.com/en-us/library/aa902651(SQL.80).aspx&lt;br&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=188024" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=188024</wfw:commentRss></entry><entry><title>Tip to run a console application in the background</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/08/16/143895.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:143895</id><created>2006-08-16T08:34:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I&amp;nbsp;created a Console app and configured it with a Windows Scheduler to run every few minutes. Whenever the schedular kicked off the app, it opened up a window in the foreground. To configure it to run on the background, you will have to run the task under an account other than the logon account. &lt;/P&gt;
&lt;P&gt;To do this:&lt;/P&gt;
&lt;P&gt;1. Open the Scheduled Tasks&lt;/P&gt;
&lt;P&gt;2. Right click on the task and select Properties&lt;/P&gt;
&lt;P&gt;3. In the properties window, type in an account other than the logon account and set the password.&lt;/P&gt;
&lt;P&gt;4. Click on OK.&lt;/P&gt;
&lt;P&gt;Now when the app runs, it runs in the background.&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=143895" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=143895</wfw:commentRss></entry><entry><title>Debugging a Console App with arguments</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/08/15/143855.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:143855</id><created>2006-08-15T09:07:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;If you are using Visual Studio .NET and try to debug a console application, by default the console application runs without command line arguments. To supply one or more arguments, follow these steps:&lt;/P&gt;
&lt;P&gt;1. In the Solution Explorer, select the project.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Select View -&amp;gt; Property Pages. The shortcut key is Shift + F4.&lt;/P&gt;
&lt;P&gt;3. In the property page window, select Debugging under Configuration Properties&lt;/P&gt;
&lt;P&gt;4. In the textbox labeled Command Line Arguments, enter one or more arguments separated by space. If your arguments have a space, you need to enclose them within double quotes. &lt;/P&gt;
&lt;P&gt;5. Click OK.&lt;/P&gt;
&lt;P&gt;6. When you debug the project now, the arguments will be passed to the application.&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=143855" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=143855</wfw:commentRss></entry><entry><title>How to find the LastModifiedDate for a file</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/07/25/142636.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:142636</id><created>2006-07-25T06:20:00Z</created><content type="text/html" mode="escaped">To find the LastModifiedDate for a file, you need a handle to the file. The LastWriteName property would then give you the last modified date. If the file is "touched" in anyway, this property is updated to the current DateTime.&lt;BR&gt;&lt;BR&gt;Here's the code for a zip file&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FileInfo zipFileInfo = new FileInfo(zipFileName);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime dtLastMod = new DateTime();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dtLastMod = zipFileInfo.LastWriteTime;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //get the last modified date of the ZIP file&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; strLastMod = dtLastMod.ToShortDateString();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; WriteLog("Last Modified Date is " + strLastMod);&lt;BR&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=142636" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=142636</wfw:commentRss></entry><entry><title>Debugging a Web Service</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/03/22/136294.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:136294</id><created>2006-03-22T04:17:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;If you are debugging a webservice remotely,&amp;nbsp; you will encounter the "Page cannot be displayed" or the generic error - "HTTP 500 - Internal Server Error" whenever the service throws an exception. If you want to know what error has occurred, you would need to turn off the friendly HTTP error messages&amp;nbsp;in IE. &lt;/P&gt;
&lt;P&gt;1. Select "Tools" from the menu in IE&lt;/P&gt;
&lt;P&gt;2. Choose "Internet Options"&lt;/P&gt;
&lt;P&gt;3. Click on the "Advanced" tab&lt;/P&gt;
&lt;P&gt;4. Look down the list for&lt;SPAN&gt; 'Show &lt;SPAN&gt;friendly&lt;/SPAN&gt; HTTP error messages'&lt;/SPAN&gt; and uncheck the tick box for it followed by the &lt;SPAN&gt;'Apply'&lt;/SPAN&gt; button at the bottom of the dialog box.&lt;/P&gt;
&lt;P&gt;Refresh the page that is displaying the HTTP 500 message to see what the error is.&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=136294" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=136294</wfw:commentRss></entry><entry><title>Splitting a string in SQL Server 2000</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/02/27/135644.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:135644</id><created>2006-02-27T09:04:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I was "select"ing from a datasource that stored data in the format "Lastname, Firstname" ex: "Smith, John". The fastest way to do this is to tokenize the string with the "," delimiter. However, I realized there is no "split" function&amp;nbsp;in SQL Server.&lt;/P&gt;
&lt;P&gt;In SQL Server 2000, a workaround would be to use the SUBSTRING() along with the CHARINDEX().&lt;/P&gt;&lt;PRE&gt;SELECT&amp;nbsp;SUBSTRING(Name, 0, CHARINDEX(',', Name)) AS LastName, &lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUBSTRING(Name, CHARINDEX(',', Name) + 1, LEN(Name)) AS FirstName&lt;/PRE&gt;&lt;PRE&gt;FROM Customers&lt;/PRE&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135644" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=135644</wfw:commentRss></entry><entry><title>Enumerating SQL Servers using C#</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/02/24/135577.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:135577</id><created>2006-02-24T05:46:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;SQL-DMO (SQL Server Distributed Management Objects) lets you programmatically get a list of SQL Servers in the network. &lt;/P&gt;
&lt;P&gt;1. Ensure you have the latest SQL Server Service Pack. You could find out which version you are using by doing a SELECT @@VERSION &lt;/P&gt;
&lt;P&gt;2. In your C# app, add a reference to sqldmo.dll (You need to select the COM tab when adding a reference)&lt;/P&gt;
&lt;P&gt;3. Add the namespace&lt;/P&gt;
&lt;P&gt;using SQLDMO;&lt;/P&gt;
&lt;P&gt;4. The code that discovers the SQL Servers is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLDMO.NameList sqlServers = sqlApp.ListAvailableSQLServers();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Note that in COM, index starts from 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;long lCount = sqlServers.Count;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i=1; i &amp;lt;= lCount; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string str = sqlServers.Item(i);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(str);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;5. Execute the application and you would see a list of SQL Servers. You could connect to a SQL Server by creating an instance of SQLServerClass as below:&lt;/P&gt;
&lt;P&gt;SQLDMO.SQLServer mysqlserver = new SQLDMO.SQLServerClass();&lt;BR&gt;mysqlserver.Connect("name of the server","sa","password");&lt;BR&gt;Console.WriteLine("Connected...");&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135577" width="1" height="1"&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=135577</wfw:commentRss></entry><entry><title>Restoring SQL database from a bak file</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2006/02/17/135378.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:135378</id><created>2006-02-17T09:26:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I was attempting to restore a SQL database from a .bak file when QA complained about incorrect Logical Name. Resolving it was a 2 step process:&lt;/P&gt;
&lt;P&gt;1. Get the Physical Name and the Logical Name by:&lt;/P&gt;
&lt;P&gt;RESTORE FILELISTONLY FROM DISK='C:\DB.BAK'&lt;/P&gt;
&lt;P&gt;Note down the LogicalName for both the MDF and the LDF file and restore the DB using:&lt;/P&gt;
&lt;P&gt;2. RESTORE DATABASE DAM FROM DISK='C:\DB.BAK' WITH MOVE 'DB_DATA_Data' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB_DATA_Data.mdf', MOVE 'DB_DATA_Log' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB_DATA_Log.ldf'&lt;BR&gt;&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135378" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=135378</wfw:commentRss></entry><entry><title>Redirecting a User to a Page after the Session times out</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2005/05/11/75021.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:75021</id><created>2005-05-11T09:06:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;I was trying to implement something similar to what you would see when you login to your bank account online. After the session times out, the user is redirected to the Login page. Here's what i used to get it to work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;In your pages, you would make the body a server control and assign an ID.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Testing.aspx&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;lt;body runat="server" id="body"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;form id="Form1" method="post" runat="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/form&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/body&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;In the code behind of the page, you would declare the &amp;#8220;body&amp;#8221; as a HtmlGenericControl and add a OnLoad Attribute&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Testing.aspx.vb&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face=Verdana&gt;Protected WithEvents body As&lt;/FONT&gt;&lt;FONT face=Verdana&gt; System.Web.UI.HtmlControls.HtmlGenericControl&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face=Verdana&gt;Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase&lt;/FONT&gt;&lt;FONT face=Verdana&gt;.Load&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;body.Attributes.Add("onLoad", "window.setTimeout(""window.location.href='login.aspx'""," &amp;amp; (Session.Timeout * 60 * 1000) + 5000 &amp;amp; ");")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;Response.Write("Wait for session to timeout..")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;End Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=75021" width="1" height="1"&gt;</content><slash:comments>5</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=75021</wfw:commentRss></entry><entry><title>Finding the ID in the eventhandler</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2005/05/09/74216.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:74216</id><created>2005-05-09T13:36:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;If you have a eventhandler handling more than one control, how would you know which of the controls invoked the handler? &lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Protected&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; PaymentChecked(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; rbfull.CheckedChanged, rbpartial.CheckedChanged&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; rbClicked &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; RadioButton&lt;/P&gt;
&lt;P&gt;rbClicked = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(sender, RadioButton)&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; rbClicked.ID = "rbpartial" &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;'Called by rbpartial radiobutton&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ElseIf&lt;/FONT&gt;&lt;FONT size=2&gt; rbClicked.ID = "rbfull" &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;'Called by rbfull radiobutton&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;End if&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=74216" width="1" height="1"&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=74216</wfw:commentRss></entry><entry><title>Another step closer to MCAD</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/sandeshmeda/archive/2005/02/12/54137.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:54137</id><created>2005-02-12T21:08:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Okay, I passed the 70-229 exam and am a step closer to getting my MCAD. I had earlier passed the 70-315 and I need to take one more test before I get my first MS certification. My prep for 229 included the Que and the MS book. Learnt quite a few new things about SQL Server that I thought never existed. It took me about 2 months of preparation for this one.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;However, the question remains. Is the certification really worth all the time and efforts?&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=54137" width="1" height="1"&gt;</content><slash:comments>3</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/sandeshmeda/commentrss.aspx?PostID=54137</wfw:commentRss></entry></feed>