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
A

Arjan Einbu

@Arjan Einbu
About
Posts
217
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • copy of sql server database
    A Arjan Einbu

    Take a backup and restore it to a new database... You can do this form SQL Server Management Studio For MS SQL Server/MS SQL Server Express, from Enterprise Manager for MS SQL Server 2000 and 7.0. From Query Analyzer, SQLCMD or other sql tools; lookup BACKUP (T-SQL) and RESTORE (T-SQL) in books online or Google.

    Database database sql-server sysadmin tutorial announcement

  • [Message Deleted]
    A Arjan Einbu

    Hva you tried googling[^] any of your questions before posting them here? Google returns this article in the top 10. It has a section on pinning attributes. http://www.c-sharpcorner.com/UploadFile/rajeshvs/PointersInCSharp11112005051624AM/PointersInCSharp.aspx[^]

    C#

  • [Message Deleted]
    A Arjan Einbu

    By using the return keyword: Like this: [return: AttributeForTheReturnValue]

    C#

  • Session like variables
    A Arjan Einbu

    Have a look at the HttpContext.Current object. You can access your session variables through it, and create some wrapper code around your session variables. Like this:

    using System.Web;

    public static class SessionHelper
    {
    public static string SomeString
    {
    get { return HttpContext.Current.Session["SomeString"] as string; }
    set { HttpContext.Current.Session["SomeString"] = value; }
    }

    public static int SomeNumber
    {
    	get { return (int)HttpContext.Current.Session\["SomeNumber"\]; }
    	set { HttpContext.Current.Session\["SomeNumber"\] = value; }
    }
    

    }

    Windows Forms design regex architecture help question

  • How do I do this in SQL
    A Arjan Einbu

    You could create the inner query like this:

    SELECT oi.CustomerID
    FROM OrderItems oi
    JOIN Products p
    WHERE p.ProductID IN ('Product1', 'Product2')
    GROUP BY oi.CustomerID
    HAVING COUNT(*) = 2

    You'll have to dynamically create the WHERE p.ProductID IN (...) part, and the value for the HAVING COUNT(*) = 2 should use a parameter. Joined with the customer table, the results could look something like this:

    DECLARE @NumberOfProducts int
    SET @NumberOfProducts = 2

    SELECT
    c.*
    FROM Customer c
    JOIN
    (
    SELECT oi.CustomerID
    FROM OrderItems oi
    JOIN Products p
    WHERE p.ProductID IN ('Product1', 'Product2')
    GROUP BY oi.CustomerID
    HAVING COUNT(*) = @NumberOfProducts
    ) AS t
    ON t.CustomerID = c.CustomerID

    Database database sales question

  • How do I do this in SQL
    A Arjan Einbu

    This can't possibly work, can it? I mean, the WHERE [Name] IN (@Products) part specifically.

    Database database sales question

  • avoid .net reflector
    A Arjan Einbu

    You can obfuscate the assembly. VS2005 includes a Dotfuscator Community Edition (light version). Many other obfuscator tools exist with prices from a couple of hundred to several thousand USD. (See also this Google search[^].)

    C# csharp security tutorial question

  • count query
    A Arjan Einbu

    You're right! I've should've seen that. It can't possibly work... Will something like this work?

    SELECT y1.Username
    FROM your_table y1
    LEFT JOIN your_table y2
    ON y1.Username = y2.Username
    WHERE y2.date BETWEEN start AND end
    GROUP BY y1.Username
    HAVING COUNT(y2.Username) = 0

    The table alias y1 represent all usernames and y2 represent only the records within the requested range.

    Database database

  • count query
    A Arjan Einbu

    You can use GROUP BY with the HAVING clause.

    SELECT username
    FROM your_table
    GROUP BY username
    HAVING COUNT(*) = 0

    Database database

  • default accessibility
    A Arjan Einbu

    Default accessibility is private for everything but namespace elements. That means classes, structs, delegates or enums that are not defined within another class are by default internal. In all other cases accessibility defaults to private. In your case, the myClass and MainConsole classes are internal.

    C# question csharp css help tutorial

  • [Solved] WS-E 2.0 problem: "Creation time in the timestamp can not be in the future" [modified]
    A Arjan Einbu

    Hi! I'm calling on a webservice with WS-E 2.0 (because I need to use Dime), and the server returns this exception message:

    Microsoft.Web.Services2.Security.SecurityFault: An error was discovered processing the <Security> header ---> System.Exception: Creation time in the timestamp can not be in the future.

    I've allready checked that the clock on both machines are in sync (also the same timezone). I've also tried different combinations of setting the <timeToleranceInSeconds> and the <defaultTtlInSeconds> settings in both the clients app.config file and the servers web.config file. still gets me the same exception... Does anyone here have any suggestions on how to fix this? -- modified at 9:53 Thursday 15th June, 2006 Found it... While trying to fix this problem, I had inadvertenly cleared the Security collection of the SoapRequestHeader, so that the other two fixes didn't seem to work... Well, they did work, after removing that statement.

    ASP.NET help sysadmin security tutorial question

  • Get XML node as 'text' data type
    A Arjan Einbu

    Try varchar(MAX) instead of text.

    Database database help sysadmin xml performance

  • Sql multiple queries [modified]
    A Arjan Einbu

    SQL Server 2005 supports having multiple readers open at the same time. (A feature called MARS). You need to add MultipleActiveResultSets=True to the connectionstring to make this work for your connection.

    string connectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;IntegratedSecurity=SSPI;MultipleActiveResultSets=True";

    C# database sales help tutorial question

  • Sql Datetime
    A Arjan Einbu

    Have you had a look at at the actual SQL string produced by your string concatenation? I'm guessing there's a format mismatch, maybe due to some regional settings or something. (Often a problem when putting datetimes into the db like this.) A safe and easy way to fix this would be to use parameters in your SQL query:

    string query = @"
    INSERT INTO orders (date,customerid,productid,sum)
    VALUES (@date, @customerid, @sum)
    ";
    SqlCommand cmd = new SqlCommand(query, con);
    cmd.Parameters.Add("@date", DateTime.Now);
    cmd.Parameters.Add("@customerid", customerid);
    cmd.Parameters.Add("@sum", sum);
    cmd.ExecuteNonScalar();

    C# database help question

  • Autologon OK, now how do you turn it off??
    A Arjan Einbu

    Take a look at the parameters of Shutdown.exe (shutdown.exe /?) or run it in interactive mode (ie. with a GUI)(shutdown.exe \i). It lets you connect to and shutdown remote PCs...

    Hardware & Devices question sysadmin windows-admin help

  • Cannot store 2000 characters in varchar(7000)
    A Arjan Einbu

    What version of SQL Server? If SQL 2000, is the row size within the page limit? In MS SQL Server versions prior to 2005, one row's data is limited to fit in one page or an 8kb block. (But the definition of a table can show a total of more than 8kb per row if you have one or more variable length columns.)

    Database com help question

  • Tell me what laptop to buy [modified]
    A Arjan Einbu

    I'm quite happy with my HP Compaq NC8230. Powerfull and good value for money. Also looked at DELL and IBM before settling on the HP.

    The Lounge c++ asp-net com business architecture

  • Anybody want an hour of sleep???
    A Arjan Einbu

    peterchen wrote:

    WITHOUT PAYING INTEREST

    Interest is payed every 4 years at the end of february... :-D

    The Lounge com tools question announcement

  • Does J.K Rowling exist?
    A Arjan Einbu

    Aftenposten is Norways second largest newspaper... (Its generally regarded as a serious one too...)

    The Lounge com tools question announcement

  • using the osql command
    A Arjan Einbu

    In Enterprise Manager: Expand the server your trying to access, then expand the Security node and click on the Logins node under Security. Here you can create a new login with Windows Authentication. -a

    Database tutorial database sql-server sysadmin question
  • Login

  • Don't have an account? Register

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