Greg Robinson's Blog

I report it, you decide

Click Once

Custom Authentication in Windows Forms

DataBinding Stuff

Favorite Links

My book contribution

My Book Reviews

My Personal Life

Richmond, VA .NET Users Group

Smart Client Stuff

What I am reading

November 2003 - Posts

UseMnemonic

This one kicked me in the butt for a few minutes this morning.  We have a custom address label which was making ampersands in names access keys.

Per the sdk:

"Note   You may want to display ampersands in a label control, rather than use them to create access keys. This may occur if you bind a label control to a field in a recordset where the data includes ampersands. To display ampersands in a label control, set the UseMnemonic property to false. If you wish to display ampersands and also have an access key, set the UseMnemonic property to true and indicate the access key with one ampersand (&) and the ampersand to display with two ampersands."

 

Richmond .NET UG looking for speakers for 2004

We are lining up our guest speakers for 2004.  If you plan to be in the Richmond, VA or surrounding areas (DC, Maryland, North Carolina) and would like to be a guest speaker, please let me know.

Configuring Code Groups with code

I have been configuring code groups with the Configuration Wizard.  Today, I finally got around to coding this up to run with our MSI.   In our code, we needed two code groups on each client workstation, one for Intranet and one of Internet access.  The below code demonstrates how simple this can be.  So, no I do not have to do this manually on all client workstations.

DimmachinePolicyLevel As PolicyLevel = Nothing

Dim ph As IEnumerator = SecurityManager.PolicyHierarchy

Do While ph.MoveNext

    Dim p1 As PolicyLevel = CType(ph.Current, PolicyLevel)

    If p1.Label = "Machine" Then

        machinePolicyLevel = p1

        Exit Do

    End If

Loop

If machinePolicyLevel Is Nothing Then Return

 

' Intranet

Dim permissionSet As PermissionSet = New NamedPermissionSet("FullTrust")

Dim membership As IMembershipCondition = New UrlMembershipCondition("http://<some ip address>/<some directory>/*")

Dim policy As PolicyStatement = New PolicyStatement(permissionSet)

Dim codeGroup As CodeGroup = New UnionCodeGroup(membership, policy)

codeGroup.Description = "FullTrust permissions for http://<some ip address>/<some directory>/"

codeGroup.Name = "AM.NET Intranet FullTrust"

' Internet

Dim permissionSet2 As PermissionSet = New NamedPermissionSet("FullTrust")

Dim membership2 As IMembershipCondition = New UrlMembershipCondition("http://<some ip address>/<some directory>/*")

Dim policy2 As PolicyStatement = New PolicyStatement(permissionSet2)

Dim codeGroup2 As CodeGroup = New UnionCodeGroup(membership2, policy2)

codeGroup2.Description = "FullTrust permissions for http://<some ip address>/<some directory>/"

codeGroup2.Name = "AM.NET Internet FullTrust"

machinePolicyLevel.RootCodeGroup.AddChild(codeGroup)

machinePolicyLevel.RootCodeGroup.AddChild(codeGroup2)

SecurityManager.SavePolicy()

Framework Bootstrapper plug in now available

http://www.gotdotnet.com/community/workspaces/workspace.aspx?ID=2F8F0A23-F529-4158-8E0A-D187D16F41F1

Meetup.com

Anybody interested in starting a .NET one here?

http://www.meetup.com/

AddNew vs. NewRow

These 2 methods have confused me for a while.  I assumed under the covers calls to AddNew created a new DataRow, marked as Detached, just like a call to NewRow does.

A control does not work directly with a DataTable .  When you bind a control, a DataView is created and the controls interacts with the datatable through that view.

So, calls to AddNew are interacting with the DataView, not the DataTable.  AddNew creates a new DataRowView

Public Overridable Function AddNew() As DataRowView

So, you will be working with a DataRowView, not a DataRow, on calls to AddNew.

Our First .NET UG Meeting

Well, we had over 45 folks attend our first Richmond, VA .NET Users Group meeting.  Many thanks to Fahrenheit Technology (http://www.hottechnology.com) for providing pizza, drinks and a home for the first meeting.  We have an awesome group.  Tons and tons of talent and enthusiasm.  Mike and I are working on a guest speakers for next year.  I you are interested in speaking, let us know.     

Has anyone read this one yet?

Ted Pattison's latest:

Building Applications and Components with Visual Basic .NET

If the content is as good as his COM+ book, I want to pick it up.  Otherwise, I have too many unread .NET books on the shelf.

 

 

 

For the Washington DC area listeners

Ted Pattison teaching Smart Clients?  Wow, too cool, we are there.

http://www.devx.com/summitdays/Article/17613

[Now Playing: Fourplay - Café l'Amour (05:19)]

More Posts