Blog Home  Home Feed your aggregator (RSS 2.0)  
kevin Mocha - SDR
Bookmarks collected from web.
 
 Tuesday, October 27, 2009
   1:  RESTORE FILELISTONLY 
   2:      FROM  DISK = 'C:\Bridge.bak'
   3:  GO
   4:   
   5:  RESTORE DATABASE Bridge
   6:      FROM  DISK = 'C:\Bridge.bak'
   7:      WITH 
   8:      MOVE 'Bridge' TO 'C:\Users\Public\Documents\Bridge.mdf',
   9:      MOVE 'Bridge_log' TO 'C:\Users\Public\Documents\Bridge_log.mdf'
  10:  GO

 

“Login Failed for user Reason: The password of the account must be changed!”
“I ran the following command to turn off MUST_CHANGE:
ALTER LOGIN UserLogin WITH PASSWORD = 'NewPassword' UNLOCK
Then you can uncheck 'Enforce password policy' and 'Enforce password expiration'
or just run the following two sql commands:
ALTER LOGIN UserLogin WITH CHECK_EXPIRATION = OFF
ALTER LOGIN UserLogin WITH CHECK_POLICY = OFF
Once both of these properties were unchecked the application ran fine with no errors.
Interesting.  I'm not sure if there was a global setting that caused this when SQL Server 2005 was installed?”

Tuesday, October 27, 2009 5:32:32 PM UTC  #    Comments [0]    |  Trackback
 Wednesday, August 19, 2009
 Monday, August 17, 2009

http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/74dac8d1-6fa7-4d23-a740-738f9c707d28

This exception says that you are deleting a relationship but not the entity association with that relationship.  Sometimes that's OK, but if your relationship is a 1-to-many (rather than 0..1-to-many) that means the entities on the many side cannot exist independent of the entity on the one side.  In your case, you are deleting the relationship between a Link and a WebPage, but the Link cannot exist on its own independent of the WebPage.
Configuring a cascade delete doesn't make it so that deleting the relationship will delete the entity--what it does is make it so that deleting the entity on one side of a relationship will cause the entity on the other side to be deleted.  So that doesn't fix the issue in this case.
The fix in this case would be to change the line at the end of FromBusinessObject from
    this.Links.Remove(entity);
to
    context.DeleteObject(entity);
Of course that also means you will need to pass the context to the FromBusinessObject method or something like that...
This change will cause the link entity to be deleted which implicitly deletes any relationships it participates in rather than just deleting the relationship between the page and the link.

 

   1:          partial void OnContextCreated()
   2:          {
   3:              this.SavingChanges += new EventHandler(onSavingChanges);
   4:          }
   5:   
   6:          private static void onSavingChanges(object sender, EventArgs e)
   7:          {
   8:              foreach (ObjectStateEntry entry in ((ObjectContext)sender).ObjectStateManager.GetObjectStateEntries(EntityState.Deleted))
   9:              {
  10:                  if (entry.IsRelationship)
  11:                  {
  12:                      AssociationType asso = (AssociationType)entry.EntitySet.ElementType;
  13:   
  14:                      if (asso.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.One && asso.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.Many)
  15:                      {
  16:                          object o = entry.OriginalValues[1];
  17:                          object ob = ((ObjectContext)sender).GetObjectByKey((EntityKey)o);
  18:                          ((ObjectContext)sender).DeleteObject(ob);
  19:                      }
  20:                      else if (asso.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.One && asso.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.Many)
  21:                      {
  22:                          object o = entry.OriginalValues[0];
  23:                          object ob = ((ObjectContext)sender).GetObjectByKey((EntityKey)o);
  24:                          ((ObjectContext)sender).DeleteObject(ob);
  25:                      }
  26:                  }
  27:              }
  28:          }
Monday, August 17, 2009 9:19:41 PM UTC  #    Comments [0]    |   |  Trackback
 Sunday, August 09, 2009

http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2general/thread/c50706c1-9406-4735-b468-07a75147fb98

If you want to access the sharing on Windows Server 2008 computer from Windows XP and Windows 2000, you have to perform the following stesps:

1. Change the settings in Network and Sharing Center

Please navigate to Control Panel >>> Network and Sharing Center, and ensure:

1. Fire Sharing: On;

2. Public folder sharing: Turn on sharing so anyone with network access can open files (or Turn on sharing so anyone with network access can open, change, and create files);

3. Password protected sharing: Turn off password protected sharing

2. Change the security settings in gpedit.msc

Please navigate to gpedit.msc >>> Computer Configuration >>> Security Settings >>> Security Options

Please change Network access: Sharing and security model for local account from “Classic-local users authenticate as themselves” to “Guest only-local users authenticate as Guest”

 

(This will make your other websites stop working if they are using Classic-local users authenticate.)

Sunday, August 09, 2009 9:05:52 PM UTC  #    Comments [0]    |  Trackback
 Thursday, January 08, 2009
 Friday, December 12, 2008

How to Debug: http://weblogs.asp.net/joshrobinson/archive/2004/12/20/327381.aspx

System.Diagnostics.Debugger.Break();

Walk Through http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

Add custom action to both install and commit

How to get installation path

string strAssemplyPath = Context.Parameters["assemblypath"].ToString();

string strAppPath = strAssemplyPath.Substring(0, strAssemplyPath.LastIndexOf("\\"));

Friday, December 12, 2008 9:46:27 PM UTC  #    Comments [0]    |   |  Trackback
 Thursday, December 11, 2008

Ultimate版的序列号:
6F2D7-2PCG6-YQQTB-FWK9V-932CC

 

Vista guests require the E1000 virtual NIC. Edit your vmx file and change/add the line ethernet0.virtualDev = "e1000".

http://bbs.vmware.cn/viewthread.php?tid=9365

http://www.realtime-vista.com/installation/2006/12/vmware_and_vista_troubles.htm

Thursday, December 11, 2008 3:57:22 PM UTC  #    Comments [0]    |  Trackback
 Wednesday, November 26, 2008

Build and Deploy .Net COM Assembly

http://www.simple-talk.com/dotnet/visual-studio/build-and-deploy-a-.net-com-assembly/

Differences of regasm.exe and regsvr32.exe

http://forums.asp.net/t/1019678.aspx

http://blogs.msdn.com/csharpfaq/archive/2004/08/02/206158.aspx

"regasm.exe is used to create COM Callable Wrapper (CCW) around .NET assemblies. .NET managed assemblies(EXEs, DLLs) are different from COM DLLs (which are unmanaged, ie. they interact with the OS directly). So to register an unmanaged DLL you use regsvr32.exe.

But if you have a managed .NET assembly and want you COM components to use it as if it were a COM assembly, then you need to use regasm.exe."

Get started with .Net Setup Project

http://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/

Wednesday, November 26, 2008 3:40:18 PM UTC  #    Comments [0]    |   |  Trackback
 Wednesday, September 10, 2008

http://channel9.msdn.com/posts/jmazner/How-To-Tell-Vistas-UAC-What-Privelege-Level-Your-App-Requires/

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1439749&SiteID=1 (Might work)

#include "stdafx.h" // includes <tchar.h>

#include <windows.h>
#include <shobjidl.h> // ShellLink
#include <shlobj.h> // IShellLinkDataList (build on Vista use shobjidl.h)
#include <objbase.h> // CoInitialize, CoInitializeEx, CoUninitialize

int _tmain(int argc, _TCHAR* argv[])
{
  HRESULT       result;
  WCHAR         wbuf[MAX_PATH];
  IShellLink*   link;
  IPersistFile* file;
  char    szFile[MAX_PATH];
  char    szProgramMenuFolder[MAX_PATH];

  // SHOULD use CoInitializeEx, but compiler can't find it.
  result = CoInitialize(NULL); // For Ex: 2nd param: COINIT_APARTMENTTHREADED
 
  // Create IShellLink object
  result = CoCreateInstance(CLSID_ShellLink,
      NULL,
      CLSCTX_INPROC_SERVER,
      IID_IShellLink,
      (void**)&link);
  if (result != S_OK) {
    CoUninitialize();
    return -1;
  }

  // Retreive the IPersistFile
  result = link->QueryInterface(IID_IPersistFile, (void**)&file);
  if (result != S_OK) {
    link->Release();
    CoUninitialize();
    return -2;
  }
  // SHOULD get from registry.
  strcpy(szProgramMenuFolder, "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\");

  // DEBUG
  strcpy(szFile, szProgramMenuFolder);
  // SHOULD use your folder and shortcut name.
  strcat(szFile, "Program Shortcut Folder\\Shortcut.lnk");
 
  // Convert the filename
  MultiByteToWideChar(CP_ACP, 0, szFile, -1, wbuf, sizeof(wbuf)-1);

  // Load the link data from the file
  result = file->Load(wbuf, STGM_READ);
  if (result != S_OK) {
    file->Release();
    link->Release();
    CoUninitialize();
    return -3;
  }

  // Look for IShellLinkDataList interface
  IShellLinkDataList* pdl;

  result = link->QueryInterface(IID_IShellLinkDataList, (void**)&pdl);
  if (result != S_OK) {
    file->Release();
    link->Release();
    CoUninitialize();
    return -4; // Where did IShellLinkDataList go?
  }

  DWORD dwFlags = 0;

  result = pdl->GetFlags(&dwFlags);
  if (result != S_OK) {
    pdl->Release();
    file->Release();
    link->Release();
    CoUninitialize();
    return -5;
  }

  // Only set SLDF_RUNAS_USER if it's not set, otherwise
  // SetFlags returns an error.
  if ((SLDF_RUNAS_USER & dwFlags) != SLDF_RUNAS_USER) {
    result = pdl->SetFlags(SLDF_RUNAS_USER | dwFlags);
    if (result != S_OK) {
      pdl->Release();
      file->Release();
      link->Release();
      CoUninitialize();
      return -6;
    }
  }
  else {
    pdl->Release();
    file->Release();
    link->Release();
    CoUninitialize();
    return 0;
  }

  result = file->Save(NULL, true);
  if (result != S_OK) {
    pdl->Release();
    file->Release();
    link->Release();
    CoUninitialize();
    return -8;
  }
  result = file->SaveCompleted(NULL);
  if (result != S_OK) {
    pdl->Release();
    file->Release();
    link->Release();
    CoUninitialize();
    return -9;
  }

  pdl->Release();
  file->Release();
  link->Release();
  CoUninitialize();
  return ERROR_SUCCESS;
}

Wednesday, September 10, 2008 6:36:58 PM UTC  #    Comments [0]    |   |  Trackback
 Monday, August 04, 2008
 Tuesday, May 27, 2008
 Thursday, May 22, 2008
        /// <summary>
        /// Information about the currently executing assembly, this is used to determine
        /// our version, etc.
        /// </summary>
        private System.Reflection.Assembly m_assemblyInfo;

        public string version
        {
            get
            {
                string ourVersion = string.Empty;
                //if running the deployed application, you can get the version
                //  from the ApplicationDeployment information. If you try
                //  to access this when you are running in Visual Studio, it will not work.
                if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
                    ourVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
                else
                    if (m_assemblyInfo != null)
                        ourVersion = m_assemblyInfo.GetName().Version.ToString();
                return ourVersion;
            }
        }

 
Thursday, May 22, 2008 8:14:17 PM UTC  #    Comments [0]    |  Trackback
 Tuesday, June 26, 2007

http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2005119&sliceId=&dialogID=2998976&stateId=1%200%203000588

 

Use the 'Underlay following section' formatting option to achieve this.

1. Create an additional Page Header section:

· Right-click the gray area to the left of the Page Header section

- Select 'Insert section below'

This inserts a second Page Header, so you now have a Page Header - a and a Page Header - b.

2. Re-size the Page Header - a section so it is the height of the page.

3. Insert the bitmap image (a .BMP file) of the pre-printed form or logo for the watermark into the Page Header -a section.

4. Go to Format | Section to open the Section Expert window, and select the Page Header - a section.

5. Select the 'Underlay following section' option.

6. Close the Section Expert.

The bitmap image in Page Header - a now appears beneath all the sections that come after it, up to the Page Footer.

The Page Headers and Page Footers cannot exceed the vertical size of the report.

NOTE: =====

Ensure that you suppress the Page Footer of the report because the Page Header cannot underlay the Page Footer.

Tuesday, June 26, 2007 8:38:41 PM UTC  #    Comments [0]    |  Trackback
 Wednesday, April 18, 2007

<!----connection string for SQL 2005 Express ----------->
<!-- <add key="DBConnStr" value="Provider=SQLOLEDB;Data Source=(local)\SQLExpress; Initial Catalog= SMARTBRIDGE; Integrated Security=SSPI;"/> -->
<!-- <add key="DBConnStrMaster" value="Provider=SQLOLEDB;Data Source=(local)\SQLExpress; Initial Catalog= master; Integrated Security=SSPI;"/> -->

Wednesday, April 18, 2007 5:51:00 PM UTC  #    Comments [0]    |  Trackback
 Friday, March 30, 2007
Friday, March 30, 2007 9:41:16 PM UTC  #    Comments [0]    |  Trackback
Copyright © 2010 Kevin Mocha. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: