FileStream Sql Server 2008

Last post 06-22-2009 2:59 AM by Wencui Qian - MSFT. 3 replies.

Sort Posts:

  • FileStream Sql Server 2008

    06-16-2009, 2:05 AM
    • Member
      286 point Member
    • shashankmishra
    • Member since 11-15-2007, 5:28 AM
    • India
    • Posts 55

    I am using FileStream feature of Sql Server 2008. I created a table but while accessing its data I am getting the following error:

    Server Error in '/' Application.

    Logon Failure: The target account name is incorrect

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ComponentModel.Win32Exception: Logon Failure: The target account name is incorrect

    Source Error:

    Line 45: 
    Line 46: // Create the SqlFileStream
    Line 47: SqlFileStream fileStream = new SqlFileStream(path,
    Line 48: (byte[])reader.GetValue(1),
    Line 49: FileAccess.Read,

    Source File: D:\Projects\TestProjects\SS2008\SS2008\SS2008\FileStream.aspx.cs    Line: 47

    Stack Trace:

    [Win32Exception (0x80004005): Logon Failure: The target account name is incorrect]
    System.Data.SqlTypes.SqlFileStream.OpenSqlFileStream(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize) +1401
    System.Data.SqlTypes.SqlFileStream..ctor(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize) +140
    SS2008.FileStream1.GetPath() in D:\Projects\TestProjects\SS2008\SS2008\SS2008\FileStream.aspx.cs:47
    SS2008.FileStream1.Page_Load(Object sender, EventArgs e) in D:\Projects\TestProjects\SS2008\SS2008\SS2008\FileStream.aspx.cs:25
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
  • Re: FileStream Sql Server 2008

    06-17-2009, 11:30 PM

    Hi shashankmishra,

    Is there any problem with the path? Also, can the account which is running asp.net application access SQL Server? I guess it's probably caused by the account. I suggest you to take a look at this article first.

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: FileStream Sql Server 2008

    06-19-2009, 6:19 AM
    • Member
      286 point Member
    • shashankmishra
    • Member since 11-15-2007, 5:28 AM
    • India
    • Posts 55

    I have gone through the article but no luck.

     Also the database is on different machine and running under administrator (local m/c) account and the ticket that I get from SqlFileStream should be validated over the network that's why the error is coming.

    If you have any idea how to resolve please let me know.

  • Re: FileStream Sql Server 2008

    06-22-2009, 2:59 AM
    Answer

    Hi shashankmishra,

    Is your ASP.NET application running under NETWORK SERVICE account? What version of IIS are you using? Can you add the account e.g. NETWORK SERVICE in SQL Server and try again? Or you could impersonate a domain user in web.config like snippet1 and add the user in SQL Server.

    snippet1:

    <identity impersonate="true" userName="domain/user" password="****" />

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)