Thanks Rob. I thought I had used DirectCast in C# too .. :-/ ... I've been
programming in both C# and VB.NET concurrently which is why I end up writing
code that looks like this.
Dim conn as SqlConnection ;
And yeah VB.NET 2.0 does have DirectCast.
Thanks for your replies gentlemen !
- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Rob Windsor [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The closest equivalent in C# is to put the type you want to cast to in
> parenthesis in front of the reference variable you want to cast. Note that
> both will fail with an exception if the cast is invalid.
>
> Dim tb As TextBox
> tb = DirectCast(Sender, TextBox)
>
> TextBox tb;
> tb = (TextBox)sender;
>
> --
> Rob Windsor [MVP-VB]
> G6 Consulting
> Toronto, Canada
> http://msmvps.com/windsor/
>
>
> "Sahil Malik" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I can't find it .. what am I missing?
> >
> > - Sahil Malik
> > http://dotnetjunkies.com/weblog/sahilmalik
> >
> >
> >
> >
>
>