Navigation

Search

Categories

On this page

Debugging Dot Net Source Code in VS2008
Concatenating rows in a table into a single string using sql
Free e-books from Microsoft Press on VS2008 technologies
Sleepless Sharepoint weekend is back..
1st look at the Asp.Net MVC Framework
Differentiating content by user privileges in Sharepoint 2007
Using MySQL with asp.net for authentication/authorization
Login Page loses styles when using Forms authentication
VS2008 released

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 23
This Year: 0
This Month: 0
This Week: 0
Comments: 7

Sign In

 Wednesday, January 16, 2008
Wednesday, January 16, 2008 4:51:53 PM (Mountain Standard Time, UTC-07:00) ( )
Its here!! You can now debug the dot net source code in VS 2008. Read more about this in Shawn's post.
I am still not sure how beneficial this will be in day to day programming, but i guess it will be helpful in troubleshooting sometimes. Especially when it looks like we have found a bug in the framework :) (For the record, i never found a bug in the framework).
-Latish Sehgal

Wednesday, January 16, 2008 4:22:21 PM (Mountain Standard Time, UTC-07:00) ( oracle | sql )
Today i came across a new scenario in one of my applications (that talks to an oracle database) where we had to concatenate a field from multiple rows in a table into a single string. While some suggested that  string manipulation could be done inside the web application code after retrieving all the data, my alert (read over-caffeinated) brain was sure that there must be a way to tackle this at the database level by manipulating the sql query. 30 minutes with the Google gods proved me correct. I have created a brief test case with the solution below, if you run into a similar situation.
 To create the test table, run CreateTable.sql (.91 KB) after saving it to your system.
 Our table looks like this, and our goal is to create a concatenated string of all the names.


 
The sql uses SYS_CONNECT_BY_PATH() (used for hierarchial queries), and the final sql is

SELECT LTRIM(SYS_CONNECT_BY_PATH(Employee_Name, ','),',') Concatenated_Names
FROM (
      SELECT Employee_Name, ROW_NUMBER() OVER (order by Employee_Name) rownumber, COUNT(*) OVER () cnt
      FROM (SELECT Employee_Name FROM Employee)
) data
WHERE rownumber = cnt
START WITH rownumber = 1
CONNECT BY PRIOR rownumber = rownumber-1;

Below is the result of the query.


-Latish Sehgal
 Friday, January 11, 2008
Friday, January 11, 2008 12:25:03 PM (Mountain Standard Time, UTC-07:00) ( VS2008 | book review | linq )
MSPress has been offering free e-books for some time on VS2008 technologies. To get yours, go here and grab your copies. The LINQ book has all the chapters but the appendix on Ado.Net Entity framework, whereas the Ajax and Silverlight book have 2 sample chapters each.



I have been wanting to try out LINQ for some time. This is the perfect opportunity, i'll review the book as well as pick up something new. I'll post my review in a later post.
-Latish Sehgal
 Friday, January 04, 2008
Friday, January 04, 2008 3:53:53 PM (Mountain Standard Time, UTC-07:00) ( Sharepoint | sleepless weekend )
Infusion is at it again, they are organizing a sleepless roadshow after the success of the Sleepless in NY sharepoint weekend, which i was fortunate enough to be a part of. Check out this video from last time. I highly recommend these events to any sharepoint/silverlight developers or anybody looking to add learn about these technologies.
This event is sponsored by .Net Rocks and will cover Washington D.C, Atlanta, Dallas, L.A, Silicon Valley and Chicago. And the goodies they give out to participants and winners are just awesome. You have to be there to believe it.

-Latish Sehgal

 Monday, December 17, 2007
Monday, December 17, 2007 1:47:27 PM (Mountain Standard Time, UTC-07:00) ( asp.net | MVC )
 Ok!! So everbody and their mother have already blogged about the new MVC Framework released with Asp.Net 3.5 Extensions preview 1 week ago, but i just got time to try it out. Its pretty different from the WebForms model, and is not meant to replace it in any way. Its an alternative that promotes test driven design and makes it easy to unit test your code. As per ScottGu, it enforces a clear separation of concerns within applications. In other words, it makes it harder for the developer to make bad design decisions, because it encourages you to keep your layout (view) separate from the data access code (model) and business logic (controller). Also, the URLs in an MVC point to the Controller and not to the view, so it gives you much more control over the URLs in your application. You also do not have the file extensions as part of the url by default, since you are pointing to the Controller class, and you can specify the method (ControllerAction) to call along with the parameters in the URL itself.  The  controller invokes the appropriate view which renders the html.
 
 To learn more about Asp.Net MVC framework, check out the following resources:
http://www.hanselman.com/blog/ScottGuMVCPresentationAndScottHaScreencastFromALTNETConference.aspx
MVC Part1
MVC Part2
MVC Part3
MVC Part4

Its quite a handful for a 1 week old technology preview framework, isn't it!!

-Latish Sehgal

 Thursday, December 13, 2007
Thursday, December 13, 2007 4:46:07 PM (Mountain Standard Time, UTC-07:00) ( Sharepoint )
 Sharepoint 2007 allows user targeting at the individual web part level. You can control what each user sees by default by enabling audience targeting on the control in its Settings, and then configuring the user groups that should see the web part under Advanced 'Settings->Target Audiences' .


You should remember though, that this only removes the control from the default view, and can still be accessed via the 'View All Site Content' link on the site. To completely remove access to a control for a user group, you should also configure the 'Permissions for the List' under 'Settings->Permissions'.

-Latish Sehgal

 Wednesday, December 12, 2007
Wednesday, December 12, 2007 11:55:45 AM (Mountain Standard Time, UTC-07:00) ( asp.net | authentication | authorization | mysql )

MySQL database is a good option for projects that need large stable databases but cannot afford the Oracle or MSSQL price tag. The provider model in Asp.Net 2.0 allows us to use MySql with plenty of Out of the Box functionality. When using Forms Authentication, you can just configure the application to use the MySQL provider, and then use the ASP.NET Web Site Administration tool to manage users and roles in your application.

1. Make sure you have installed the latest version of MySQL Connector/Net. This also adds an entry each to the membership and rolemanager providers in the machine.config files behind the scenes.
2. Open the Asp.Net Web Site Administration page, go to  'Provider ' tab and click on "Select a different provider for each feature (advanced)".
3. Select ' ' as the Membership Provider, and ' ' as the Role Provider.


4. Add the connectionstring to your MySQL server under the name 'LocalMySQLServer'.
        <remove name="LocalMySqlServer"/>
        <add name="LocalMySqlServer" connectionString="server=localhost;database=mbs;uid=root;pwd=mbs"/>

5. Goto 'Security' tab and manage your users and roles.

 Saturday, December 08, 2007
Saturday, December 08, 2007 5:24:47 PM (Mountain Standard Time, UTC-07:00) ( asp.net | login | stylesheet )
One of my colleagues faced this problem recently while working on a new asp.net site, where his login page was not rendering as per the default stylesheet whereas all the pages displayed fine once the user logged in. When i looked at his web.config file, i saw that anonymous access was blocked to all resources on the site, and adding an <location> element allowing anonymous access to the images and stylesheets folder fixed the issue.
It looks something like

<location path="img">
     <system.web>
            <authorization>
                    <allow users="*"/>
           </authorization>
    </system.web>
</location>


-Latish Sehgal
 Monday, November 19, 2007
Monday, November 19, 2007 1:45:43 PM (Mountain Standard Time, UTC-07:00) ( VS2008 )
linky
Yay for javascript intellisense..