title: Error number 2202 when creating user group for sql server 2008 using C# VS 2008 in Vista
body: <p>I'm trying to create user group for registered in SQL Server 2008. </p>
  
  <p>This is my code : </p>
  
  <pre><code>[DllImport("Netapi32.dll", CharSet=CharSet.Unicode)]
  internal static extern int NetLocalGroupAdd([In, MarsharAS(UnmanagedType.LPWStr)]     string serverName,[In] int level, [In] reg NativeHeaders.LOCALGROUP_INFO_1 info0, out int     paramError);
  
  internal struct LOCALGROUP_INFO_1
  {
      public string lgrpi1_name;
      public string lgrpi1_comment;
  }  
  
  $ always return error number 2202( User name not valid )
  Public void CreateWinAuthGroup ()
  {
          var localgroup_info_ = new LOCALGROUP_INFO_1
          {
              lgrpi1_name = "TesUserGroup",
              lgrpi1_comment = "Group for My Application"
          }
           int error = NetLocalGroupAdd(serverName, 0, ref localgroup_info_, out paramerror);
  
  }  
  </code></pre>
  
  <p>Has anyone else faced this issue? This source running well on my standalone test application. But always returns error when integrated with main application.</p>
  
  <p>Thanks for any help.</p>