DCSIMG
June 2009 - Posts - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2012 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

June 2009 - Posts

VelocityAdminShell is Published on CodePlex

VelocityAdminShell is Published on CodePlex

I’ve published the VelocityAdminShell tool that I wrote about yesterday on CodePlex.
You can download the project with its source code from here.
As I wrote, if you have any suggestions for improvement or you encounter bugs
please contact me in the blog’s contact form or from the CodePlex tool’s site.
I’ll keep on updating the tool in the near future.

Enjoy!

DotNetKicks Image

ADO.NET Entity Framework Session

ADO.NET Entity Framework Session

I know that it is very early to announce,.Net Framework New Logo
but I’m scheduled for an Entity Framework
half a day session on October 19 in Microsoft
Israel. In that session I’m going to talk about
Entity Framework and in particular about
LINQ to Entities and the new features of EF4.
If you want to hear the session you can sign in to it from here.

I hope to see you there.

DotNetKicks Image

Velocity Administration Console

Velocity Administration Console

Lately I’ve been working on a small administration console project for
Microsoft project code named Velocity. If you don’t know, Velocity’s
administration is being done with PowerShell.
I decided to build a console that will do the same thing but in Windows Forms.
The following figure shows the tool I’ve built:
Velocity Administration Console

You can download the tool from here.

Pay attention that the project is still in develop so bugs can occur!

The following things are changes you need to do manually in the
VelocityAdminConsole.exe.config file to enable the console:

  • VelocityFileSystemConnectionString – if you chose to manage the cluster
    in a shared network folder, put here the path to that folder.
  • VelocitySQLConnectionString – if you chose to manage the cluster in a
    SQL Server, put here the connection string to the SQL Server.
  • ClusterName – put here the cluster name.
  • Provider – put here the provider you use.

You can expect more features like installation project in the near future. 
As I wrote, the project is still in development and this is why I didn’t publish it
in CodePlex. I promise to put the project in CodePlex in the near future.
If you have any suggestions for improvement or you encounter bugs please
contact me in the blog’s contact form.
I hope you’ll find this console helpful.

DotNetKicks Image

New Tracing and Caching Wrapper Providers for Entity Framework

New Tracing and Caching Wrapper Providers for Entity Framework

Yesterday two new Entity Framework New Tracing and Caching Wrapper Providers for Entity Framework
Wrapper Providers
were added to
MSDN Code Gallery. The new providers:

  • EFTracingProvider – adds the ability to
    log SQL commands that are executed against
    the data storage

  • EFCachingProvider – adds query results cache to Entity Framework

These providers will add more power to Entity Framework especially the
caching provider that also enables using Microsoft Distributed Cache
codename "Velocity"
.
You can look at the announcement in Jaroslaw Kowalski’s blog and get some
details here. You can download the providers from here.
Thanks to Guy Burstein for pointing out this release.

DotNetKicks Image

Programming Entity Framework Book Review

Programming Entity Framework Book Review

One of the books I read in Programming Entity Framework Book Review
the last weeks was
Julia Lerman’s
Programming Entity Framework book.

Review

Julia Lerman’s book is currently the best
choice if you want to learn
Entity Framework. The book is very
thorough and even though it is very long
to my taste (about 800 pages) it is written
very good. The book covers almost every aspect
in Entity Framework and also suggests some
solutions to problems that V1 has like for
example an approach to N-Tier applications.
The book has a web site with all the code
examples and more materials that you can download.
The author builds the knowledge base of the readers layer on top a layer
in a very easy to follow manner. She doesn't assume that the reader
is a .NET programmer or know Entity Framework so you get all the
details that you need to understand the framework (and nothing more).
As someone that use Entity Framework from its early days, I got to learn
some new stuff so the book was very helpful.

Summary

Lets sum up, as I wrote the book is very impressive. It’s written
in a fluent language that helps to understand the materials. I found myself
learning more things that I didn’t know about Entity Framework so to me
the book was valuable. My rating of the book is 5 stars out of 5.

DotNetKicks Image

Entity Framework Tips by Alex James

Entity Framework Tips by Alex James

Lately I ran into Entity Framework Tips by Alex James
Alex James blog (Meta Me)
and into his Entity Framework Tips
index page. Currently, there are 24
good tips there and the count is still
running.
If you are using Entity Framework or interested in Entity Framework,
I encourage you to visit that page and to read the tips.
Thanks for sharing Alex!

DotNetKicks Image

Creating AutoCompleteExtender Trigger Button

Creating AutoCompleteExtender Trigger Button

Yesterday I’ve been
consultingCreating AutoCompleteExtender Trigger Button at a client.
During the day, I got a
question regarding
ASP.NET AJAX
Control Toolkit
’s
AutoCompleteExtender.
The question was how
to create a trigger button to the AutoCompleteExtender in order to
go to the server and fetch the results.
This post will describe how to do that.

Creating an Autocomplete Web Service

The first thing to do when you want to use the AutoCompleteExtender
is to create the web service that you’ll connect to. In my example, I’m
going to use the following suggestions web service:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public class SuggestionsService : WebService
{
    [WebMethod]
    public string[] GetSuggestions(string prefixText, int count)
    {
        List<string> results = new List<string>();
        for (int i = 0; i < count; i++)
        {
            results.Add(string.Format("{0}{1}", prefixText, i));
        }
 
        return results.ToArray();
    }
}

Creating The Web Page

After we have our service, it is time to create our web page.
The following web page contains a text box with the
AutoCompleteExtender and a button to trigger the auto complete
from client side:

<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>        
            <asp:TextBox ID="txtAutoComplete" runat="server"></asp:TextBox>
            <cc1:AutoCompleteExtender ID="SuggestionsAutoComplete" runat="server" 
                TargetControlID="txtAutoComplete" ServiceMethod="GetSuggestions" 
                ServicePath="SuggestionsService.asmx" MinimumPrefixLength="1"
                CompletionSetCount="20">
            </cc1:AutoCompleteExtender>
            <br />
            <asp:Button ID="btnTrigger" runat="server" Text="Trigger Auto Complete" 
                OnClientClick="BLOCKED SCRIPTshowAutoComplete()"/>        
        </div>
</form>

 

 

Nothing special here.

The Trigger Function

The following method is the trigger function:

<script type="text/javascript">
    function showAutoComplete() {
        var autoComplete = $find('SuggestionsAutoComplete');
        autoComplete.get_element().focus();
        autoComplete._textBoxHasFocus = true;
        autoComplete.get_element().value = '';
        Sys.Net.WebServiceProxy.invoke(autoComplete.get_servicePath(),
           autoComplete.get_serviceMethod(),
           false,
           { prefixText: '', count: autoComplete._completionSetCount },
           Function.createDelegate(autoComplete, autoComplete._onMethodComplete),
           Function.createDelegate(autoComplete, autoComplete._onMethodFailed),
           '',
           5000);
 
        $common.updateFormToRefreshATDeviceBuffer();
    }
</script>

First I find the extender. Then, I set focus on the extender.
Without setting the focus on the extender nothing will work.
After the focus setting, I use the Sys.Net.WebServiceProxy.invoke
method which will invoke the auto complete. The last thing to do is to
use the $common.updateFormToRefreshATDeviceBuffer method which
is registered by the AutoCompleteExtender in order to make
updates to form elements and to refresh their document buffer
to what is showing live in the browser.

Summary

Lets sum up, today I showed a simple solution to a demand that was
raised by a customer. As I could see in my searches on the net that
demand is common so I hope this solution will help you if you need
that functionality.

DotNetKicks Image

Audience Specific Documentation for the Entity Framework

Audience Specific Documentation for the Entity Framework

In MSDN Code Gallery thereAudience Specific Documentation for the Entity Framework
is a audience specific documentation
for the Entity Framework
. That
documentation is divided to
three documents:

  • Entity Framework for architects documentation:
    Aimed at enterprise or application architects who are evaluating
    the Entity Framework, or who are designing systems that will use
    the Entity Framework.
  • Entity Framework for domain developers documentation:
    Aimed at object oriented developers who focus on the problem
    domain of an application.
  • Entity Framework for database developers documentation:
    Aimed at database-centric developers.

You can download the specific documentation you need from here.
Enjoy!