Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Dave Bacher

@Dave Bacher
About
Posts
12
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • error while running from a network machine
    D Dave Bacher

    Programs run from a network share run with a lower permission than applications run from the local machine. This is because the network share could be a WebDav drive out on the internet, etc. The first thing is, the connection string won't work from your machine. When your machine runs the code, it will see "Data Source=(local)," and it will attempt to attach to your machine and not the networked machine. Presumably, you want to run against the databse on the network machine. So your connection string needs to look like: Data Source=SERVER\.;Initial Catalog=Rsch1;Integrated Security=SSPI Additionally both your machine and the server must be members of mutually trusted domains, or SSPI will fail. If you are in a workgroup, you probably can't use integrated security (SSPI) reliably, but your milage may vary. Of course, in my version of the connect string, SERVER needs to be either the IP Address of your SQL Server or its machine name -- it shouldn't be the word SERVER unless that happens to be what its name is. Also, you need to make sure that SQL Server is configured to allow remote connections (Surface Area Manager in newer versions configures it for connections from the same machine only by default -- you can change this in your management tool). Additionally, when you are running from a network share, you lose permissions from the .NET framework. When you run from your local drive, you run at full trust. When you run from a network share, you don't run at full trust. This is a defense mechanism against Worm programs and other attacks. In control panel, you can use the .NET Configuration Assistance to trust the assembly or publisher. If you are on a corporate network, you want to have a domain administrator update the group policy to allow the executable the necessary permissions. If you are using .NET 2.0, the SDK provides a program that can tell you the exact permissions your application requires. The tool is named SecUtil, and it usually is in C:\Program Files\Microsoft.NET\SDK\v2.0\bin\secutil -- depending on your install order versus mine, it may be in a different location (I install the SDK, then install Visual Studio -- if you install the SDK as part of Visual Studio, then it ends up under Visual Studio somewhere). There is documentation on the tool on Microsoft's site. Note that you'll have to adjust the machine configuration or user configuration to trust the assembly -- there is nothing you can do on the network share to trust it. This is a defense mechanism. The best

    Visual Basic question database sysadmin security help

  • MAPI
    D Dave Bacher

    The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting. First, see if System.Web.Mail will get the job done for you -- if it will do what you need, use it. I have not used it with Thunderbird, so I don't know if it will call through. If System.Web.Mail won't get the job done, then try Collaboration Data Objects (CDO), and verify it won't get the job done. If CDO works, it will be a better choice than MAPI. It gives you an object model, etc. and doesn't require nasty p/Invoke calls. The MAPI32.DLL switch operates based on these registry keys (source: Platform SDK) HKEY_LOCAL_MACHINE\Software\Clients\Mail\(default) HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider1 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider2 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider3 Where Provider1, Provider2 and Provider3 are MAPI providers. Underneath each provider, find the following: (default) -- this is the display/text name of the provider DLLPath -- this is the file name (without a path) of the DLL DLLPathEx -- this should be the fully qualified path MSI* -- information to do the install Also check for these registry entries, which can overide the MAPI used for specific applications: HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::exchng32.exe = "" (route call directly to Mapi32x.dll) HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::msspc32.dll = "Microsoft Outlook" (route call using Microsoft Outlook key under HKLM\Software\Clients\Mail) Also, try this (from platform SDK): In the event that an application overwrites Mapi32.dll, you can restore it using Fixmapi.exe. Fixmapi.exe can be found in the same location as the stub library itself, usually C:\Winnt\System32 for Microsoft Windows NT version 4.0 systems. This utility copies the current Mapi32.dll (the new DLL that overwrote the stub library) to Mapi32x.DLL, and then copies the stub image, contained in the Mapistub.dll file, to Mapi32.dll. There are no arguments for Fixmapi.exe. If the MAPI DLL was provided by Netscape or Eudora e-mail clients, the DLL is renamed to Nsmapi.dll or Eumapi.dll respectively, and the appropriate HKLM\Software\Clients\Mail subkey and DLLPath value are created. The DLLPath value points to the renamed DLL because neither DLL supports extended MAPI calls, so the DLLPathEx value is not needed. Again, if at all possible I would go with System.Web.Mail or CDO. These should "do the right thing" an

    Visual Basic windows-admin algorithms help question

  • WebDeveloper 2005 vs. Firefox
    D Dave Bacher

    Anonymous wrote: I have Firefox as my default browser and when I try to debug an ASP.NET application the ASP.NET Development Server requires a password and login when using Firefox. All is fine in IE 6.0. Any idea if there is a way to select a different browser than the default one? What is this login that the ASP.NET Development server requires? FireFox responds to NTLM requests by prompting for username and password. You can provide a valid domain log on (whatever you use for logging in to your PC), and it will give you access. It's a difference in philosophy. FireFox doesn't authenticate to a server without user intervention (as dictated by W3C). FireFox does prompt you, and allow you to provide the information to authenticate if you want to. Alternatively, you may provide the information as part of the URL, and FireFox will use that information: http://username:password@localhost/WebApplication1 Note that IE will display a very similar box if the remote rejects the NTLM information. To see this, hit your application from a computer that is not a member of a trusted domain. As with FireFox, providing valid information on a trusted domain will get you access.

    ASP.NET question csharp asp-net visual-studio sysadmin

  • write code
    D Dave Bacher

    ActiveUp has a nice, open-source date/time control that provides drop-downs like you're asking about, and is as easy to use as the built-ins. You can use Google to find it.

    ASP.NET csharp tutorial asp-net database sql-server

  • Login failed
    D Dave Bacher

    As the other post states, this says you need to have valid NT credentials. You have several options for providing these credentials. The other response I see suggests granting the ASP.NET working process rights on the database. I would suggest you don't want to do this. What you really want to do is create a new Windows user as a copy of the ASP.NET working process, and alter the impersonate line in web.Config of your application to use that Windows user. Then, grant that user the necessary rights in SQL Server to get at the data they need access to. You want a new, separate Windows user for each and every ASP.NET application, and you want to grant each application only the rights that it needs in SQL Server. By doing things the right way, and encouraging others to do things the right way, we -- together -- can all help stop security-based attacks on all systems. In this case, if you grant ASP.NET rights to the database, then any web application that will ever be installed on your computer gains access to the database, and all of the data in it. Any attacker who manages to get code injected into your website has access to all the data in your database. If you create individual users, at most only one user's data is compromised. Ideally you also use only stored procedures to access data, so that an attacker cannot run arbitrary queries.

    ASP.NET csharp com beta-testing help question

  • Asp.net -> 2nd Web server
    D Dave Bacher

    The easiest way to do this, assuming you have Visual Studio, is to create a solution with the old web project, and then create a new web project on the new server, and delete any generated ASPX pages from the wizard. Have both project open in your solution, and drag the ASPX file from the old project to the new one. If you're using the session object, you'll need to modify web.config so that both machines use one session server, or else you'll end up with problems as well. You don't have to use the session server.

    ASP.NET csharp asp-net sysadmin regex question

  • IE plugin
    D Dave Bacher

    You might be able to do this with JavaScript and CSS2. You can draw a box around any HTML element (tag) and it's content using the border property in CSS2. You can catch a click or modify the context menu through JavaScript. By having two classes, you could change the class when the word is clicked, etc. Without knowing more of your application, I can't answer if you need a plug in or not, but it's very likely you can do it with JavaScript.

    ASP.NET

  • Create Own new event Handlers ASP.Net
    D Dave Bacher

    Web pages consist of two parts. There is a part on the client in (D)(X)HTML, and there is a part on the server (the ASP.NET page and codebehind). Anything that happens in the ASP.NET code behind (or inline server side elements, such as <% %>) requires a post back. Post backs are slow (it's like if you typed a new address and hit enter, it has to go talk to the server), so you don't want to generate them if you can avoid it. So it's very likely what you are wanting to do needs CSS2, DHTML and/or JavaScript. If you go and do a search in Google for DHTML and JavaScript, you'll find some starting points. CodeProject has some nice articles. You can register a block of client script with the RegisterClientScriptBlock method of the Page object. This creates a block of script with a unique identifier identifying it, so if it's called for the same script a few times, you only get one copy of the code. You can register a post-back event handler using Page.GetPostBackEventReference. It creates the necessary code, and returns a string containing the code to cause a post back to the server. In some cases, the string it returns might not be what you want, you might want to generate other code (it posts back a single string parameter -- if that's not what you want, you have to write JavaScript to get what you want into the parameter). The events you can hook are determined by the specific client browser and the element you are placing a hook on. You need to look at a DHTML reference to see what events are available, and what they are named. Note if you need to run on non-Microsoft browsers, you'll need to look up what events are common, and what they are named. Standards compliant browsers sometimes use different names from Microsoft's, and sometimes require different code from Microsoft's. Typically, the code will look something like this: You can do this either from code behind or from the ASP.NET page itself, depending on if you need to dynamically generate the JavaScript or not. Additionally, on standards compliant browsers (or on IE 6 with ie7.sf.net loaded), for many effects, you don't need to use JavaScript at all. Using CSS2, you can implement mouse overs where a graphic changes, for example. The benefit to using CSS2 is that it is a standard, and supported natively by the browser, so you have less maintenence.

    ASP.NET csharp asp-net help tutorial

  • Login failed
    D Dave Bacher

    Toasty0 wrote: Login failed for user 'sa'. Any suggestions on what to look for to fix this failure? Do you have save credentials on, or are you providing the password (likely "changeoninstall") to the user in code? By default, visual studio doesn't save the password.

    ASP.NET csharp com beta-testing help question

  • How to keep an object alive after Page_Load &amp; PostBacks?
    D Dave Bacher

    Use the session object. Session["variable_name"] = object; // store an object in session return Session["variable_name"]; // retrieve an object from session that's assuming you want the object on a particular ASP.NET session.

    ASP.NET sysadmin tutorial question

  • ASP.NET Hosting Solution?
    D Dave Bacher

    This is a link to a site that rates hosts: http://www.tophosts.com/pages/top25/ AIT (the #2 provider on the list, happened to be looking at dedicated hosts this morning) offers a dedicated host for $40/month running Windows 2003, and allows more bandwidth. For $8/month, they have ASP.NET hosting (it's near the bottom of the feature matrix, listed as "Windows .NET"). APlus.net has shared hosting at $6/month and dedicated servers starting at $49.

    ASP.NET question csharp asp-net hosting beta-testing

  • Split Combo Box (ala Access)
    D Dave Bacher

    Was wondering if anyone has a starting point for a combo box that works similarly to Access' for ASP.NET (C# or VB.NET is fine). I have a table that looks like this (we're working with a real database, XML is to make it easy to talk about): ACCT Accounting HR Human Resources The idea is to have a drop-list like field showing just the abbreviation, but when the list is dropped, that would show both fields. Has anyone attempted something like this before? We'd prefer to avoid the commercial controls; I'm aware there are plenty that do this sort of thing. My current thought would be to use a div with a text box and an image. In onclick of the image, pop up a div with a table and border, and in onclick of the table set the text box. On the ASP.NET side of things, introduce a new server control that generates that markup (so that we can reuse it in other projects).

    ASP.NET csharp html asp-net database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups