Jagadish's profileJagadish Pulakhandam'sPhotosBlogListsMore Tools Help

Blog


    October 13

    TIP: How to fix readonly external hard disks to function in normal mode?

     
    Intermittently, your external harddisk may turn to readonly mode.  I am talking about the harddisks which do not have any exclusive read-only switch/locks.  Even if you restart or plug-in to another computer, the readonly mode may not change.
     
    To make it functioning in write mode as well, just do the following steps:
     
    1.  Go to command prompt
    2.  Type "DISKPART" and hit enter.  You will get "DISKPART>" prompt.
    3.  type "SELECT VOLUME Z" at the "DISKPART" prompt ("Z" being the drive letter of the readonly external hard disk.  You need to provide your own drive letter here).  The command has to return with "Volumn 4 is the selected volume" (your volume number could be different) followed by DISKPART prompt.
    4.  type "ATTRIBUTES VOLUME CLEAR READONLY" at the "DISKPART" prompt.  This would clear the "READONLY" attribute of the hard disk.  It has to return with the message "Volume attributes cleared succesfully".
    5.  type "EXIT" at the "DISKPART" prompt to get back to normal prompt.
     
    I managed to get the above working (twice) with 1.5TB Western Digital External Disk on Windows Server 2008.
     
    thanks
    Jag
     
    February 04

    Article: How to bind ComboBox and DataGrid controls in Silverlight 2.0

     
    Hai,
     
    My next article on Silverlight 2.0 focusing on "Binding ComboBox and DataGrid controls" got published here http://www.aspfree.com/c/a/BrainDump/Introduction-to-Binding-ComboBox-and-DataGrid-Controls-in-Silverlight-20/
     
    Enjoy..
     
    thanks
    Jag
    January 16

    My first day with Windows 7 (beta)

     
    Hai Everyone,
     
    Yesterday, I was lucky enough to receive first version of "Windows 7 Beta" installed successfully on my machine.  Definitely, it is the most exciting "Windows" release ever.  It is almost impossible to cover all of its great features in one single post.  Let us see how it looks with default color scheme for the first time:
     
     
    Let us see the first set of cool things which are eye catching:
     
     
     
     
     
     
     
     
     
     
     
     
     
    More on next post.
     
    thanks
    Jag
    January 15

    Article: Designing WCF DataContract Classes Using "LINQ to SQL" Designer

     
    Hai,
     
    My new article on "Designing WCF Data Contract Classes using "LINQ to SQL" Designer" got published here.
     
    thanks
    Jag
    December 13

    Article: Database operations using Silverlight 2.0, WCF and LINQ to SQL

     
    Hai,
     
    My next article focusing on development using Silverlight 2.0, WCF and LINQ to SQL got published here http://www.aspfree.com/c/a/Windows-Scripting/Database-operations-using-Silverlight-20-WCF-and-LINQ-to-SQL/
     
    Enjoy......
    Jag
    December 04

    Article: LINQ to XML Programming using Visual Basic 2008

     
    Hai,
     
    My new article on "LINQ to XML programming using Visual Basic 2008" got published here http://www.aspfree.com/c/a/VB.NET/LINQ-to-XML-Programming-Using-Visual-BasicNET-2008/.
     
    Another article on on "XML DOM programming using Visual Basic 2005" got published here http://www.aspfree.com/c/a/Windows-Scripting/Visual-Basic-2005-XML-Programming-Using-XML-DOM/
     
    thanks
    Jag
    November 14

    Article: Silverlight 2.0 application with "LINQ to SQL" and WCF Service

     
    Hai,
     
    My new article on "Silverlight 2.0 application development with 'LINQ to SQL' and WCF Service" got published here http://www.aspfree.com/c/a/Windows-Scripting/Silverlight-20-Application-Development-with-LINQ-to-SQL-and-a-WCF-Service/
     
    thanks
    Jag
    November 07

    Article: Creating a Silverlight 2.0 Application that Consumes a WCF Service

     
    Hai,
     
    My new article on "Silverlight 2.0 accessing WCF Service using Visual Studio 2008" got published here http://www.aspfree.com/c/a/Windows-Scripting/Creating-a-Silverlight-20-Application-that-Consumes-a-WCF-Service/
     
    thanks
    Jag
    October 30

    Article: Beginning Silverlight 2.0 development using Visual Studio 2008

     
    Hai,
     
    My new article on "Beginning Silverlight 2.0 development using Visual Studio 2008" got published here http://www.aspfree.com/c/a/BrainDump/Beginning-Silverlight-20-Development-using-Visual-Studio-2008/
     
    thanks
    Jag
    October 10

    Article: Understanding Delegates using Visual Basic.NET 2005

     
    All,
     
    My new article on "Delegates using Visual Basic 2005" got published here http://www.aspfree.com/c/a/VB.NET/Understanding-Delegates-using-Visual-BasicNET-2005/
     
    It explains delegates in a simplest fashion.  If you are new to eventing in Visual Basic, make sure that you complete this http://www.aspfree.com/c/a/VB.NET/Understanding-Custom-Events-using-Visual-Basic-NET-2005/ before you go to delegates.
     
    thanks
    Jag
    August 20

    Beginning Sharepoint Web part development using Visual Studio 2008

     
    Everyone,
     
    My new article on "Sharepoint Web Part development using Visual Studio 2008" got published here:
     
     
    This will be a great introduction to beginners who would like to learn developing web parts using WSS 3.0 (Windows Sharepoint Services) together with Visual Studio 2008.
     
    It covers the following:
     
    -> creating a new WSS test web site
    -> creating a new WSS web part page
    -> developing a simple web part using WSS 3.0 and Visual Studio 2008
    -> Deploying and viewing the web part
    -> Debugging the web part.
     
    Hope you will enjoy reading it.
     
    thanks
    Jag
    July 17

    Tip: Generating iCalender file using ASP.NET

     
    iCalender is something like an open format text file to add items to the calendar (like Outlook calendar).  It is simply a text file which contains fields and information about the particular event of a calendar.  Once you double click on the iCalendar file, the respective event gets registered in Outlook calendar (of course, with your approval for the event!).
     
    Following is the ASP.NET code, which generates iCalendar file dynamically (on the fly) and pushes the same to user.  The user can either directly open it into Outlook or simply save the iCalendar file.
     

    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

            Dim sb As New StringBuilder(215)

            sb.AppendFormat("BEGIN:VCALENDAR{0}", Environment.NewLine)

            sb.AppendFormat("CALSCALE:GREGORIAN{0}", Environment.NewLine)

            sb.AppendFormat("VERSION:1.0{0}", Environment.NewLine)

            sb.AppendFormat("BEGIN:VEVENT{0}", Environment.NewLine)

            sb.AppendFormat("DTSTART:20080703T093000{0}", Environment.NewLine)

            sb.AppendFormat("DTEND:20080703T113000{0}", Environment.NewLine)

            sb.AppendFormat("LOCATION:testing some location{0}", Environment.NewLine)

            sb.AppendFormat("SUMMARY:Testing Some subject{0}", Environment.NewLine)

            sb.AppendFormat("CLASS:PUBLIC{0}", Environment.NewLine)

            sb.AppendFormat("END:VEVENT{0}", Environment.NewLine)

            sb.AppendFormat("END:VCALENDAR{0}", Environment.NewLine)

     

            Dim enc As New UTF8Encoding

            Dim arrBytData() As Byte = enc.GetBytes(sb.ToString)

     

            Response.Clear()

            Response.ContentType = "text/plain"

            Response.AppendHeader("Content-Disposition", "attachment; filename=vCalendar.ics")

            Response.AppendHeader("Content-Length", arrBytData.Length.ToString())

            Response.ContentType = "application/octet-stream"

            Response.BinaryWrite(arrBytData)

            Response.Flush()

            Response.End()

        End Sub

    End Class

     
    thanks
    Jag
    June 02

    Free Book: .NET Developer's guide to Windows Security

    In depth guide to programming Windows Security using .NET is covered in ".NET Developer's guide to Windows Security".  Best of all, it is available FREE to read it on-line. 
     
     
    Thanks Keith, for helping .NET developer communities with such a good resource.
    Jag
    May 21

    Learning "LINQ to SQL" queries from SELECT statement: basics

    Hai,
     
    My first article on "Querying LINQ to SQL" got published here
     
    It covers the following (in both VB.NET and C#):
     
    -> fetching rows from a table using LINQ
    -> Column aliasing and columns of expressions using LINQ
    -> DISTINCT values using LINQ
    -> ORDER BY using LINQ
    -> Filtering rows
    -> dealing with IN, LIKE and IS NULL operators using LINQ
     
    More to be published soon....
     
    thanks
    Jag
    April 07

    Working with "LINQ to SQL Designer" using Visual Studio 2008

    Hello,
     
    My new article on "LINQ to SQL Designer" got published here http://www.aspfree.com/c/a/.NET/Introducing-LINQ-to-SQL-Designer-using-Visual-Studio-2008/
     
    It is very similar to my previous article except that this one focuses on "LINQ to SQL Designer".
     
    thanks
    Jag.
    March 31

    Beginning "LINQ to SQL" using Visual Studio 2008

    Hai,
     
     
    It covers all the following topics:
     
    -> Developing a simple "LINQ to SQL" application without using "LINQ to SQL" designer
    -> Retrieve and update information using "LINQ to SQL"
    -> using DataContext object in LINQ development.
    -> Source Code in both Visual Basic and C#
     
    Hope it helps.
     
    thanks
    Jag
     
     
    March 13

    TIP: Viewing the generated SQL of LINQ statements

    Even though LINQ uses the familar syntax as of SQL, it is not the same SQL generated at run-time.  To view the SQL generated from LINQ, we can use "Log" property of "DataContext" in the following manner:
     
                  Dim obj As New SampleDAL.SampleDataContext
            Dim s As New StringWriter
            obj.Log = s
            Me.GridView1.DataSource = From p In obj.emps _
                                      Where p.deptno = 10 _
                                      Select p
            Me.GridView1.DataBind()
            Me.Label1.Text = s.ToString
     
    You can also make use of VS integrated debugger as shown here
     
    Hope this helps...
     
    thanks,
    Jag

    TIP: Modifying Connection String dynamically for a strongly typed dataset in a different assembly

    Imagine, I am working on a Visual Studio 2005/2008 solution with class library project (DAL) and Web Application Project (ASP.NET).  Say, the DAL is being developed using Dataset Designer with different Strongly Typed DataSets/DataTables together with TableAdapters.  Then I would certainly run into a problem.
     
    The DAL (by default) maintains its own connection string in application configuration settings (app.config) and the ASP.NET application maintains its own connection string in Web.config file.  Any project, by principle, should not contain connection strings at more than one location.
     
    To make DAL pickup Connection String automatically from web.config by itself (without writing any code) during run-time,  simply make sure that the names of connection strings (not the values) are identical in both app.config and web.config.
     
    To make DAL pickup Connection String dynamically from web.config during run-time (at least).  It can be easily accomplished by adding the following code to the "MySettings" class in "Setting.Designer.vb" file.
     
    Private Sub MySettings_SettingsLoaded(ByVal sender As Object, ByVal e As System.Configuration.SettingsLoadedEventArgs) Handles Me.SettingsLoaded
                Dim s As MySettings = TryCast(sender, MySettings)
                s.Item("SampleConnectionString") = System.Configuration.ConfigurationManager.ConnectionStrings("cnDev").ConnectionString
            End Sub

     
    To make the above work, you may also need to refer to "System.Configuration" in your class library project.
     
     
    Hope the above solves the problem...
     
    thanks
    Jag