Professional Web Applications Themes

can't get past ExecuteNonQuery() - Microsoft SQL / MS SQL Server

Try sqlInsertCommand2.CommandType = CommandType.StoredProc (This might not be the exact syntax but will be close). -- Michael Culley...

  1. #1

    Default Re: can't get past ExecuteNonQuery()

    Try

    sqlInsertCommand2.CommandType = CommandType.StoredProc

    (This might not be the exact syntax but will be close).

    --
    Michael Culley


    Michael Guest

  2. #2

    Default Re: can't get past ExecuteNonQuery()

    i'm getting 'system.data.sqlclient.sqlexception' as the reason that it
    crashes..
    ???
    thanks,
    Trint

    .Net programmer
    com

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trint Guest

  3. #3

    Default Re: can't get past ExecuteNonQuery()

    Trint Smith (com) writes: 

    The best way to debug an error situation, is to set up the error
    handler, so that you get the text of the error message from SQL
    Server. Only knowing that something is wrong, but not knowing what is
    like looking for that needle in the hay stack.

    In any case, you have not included the file name in single quotes,
    so I would expect SQL Server to generate a syntax error.

    And the suggestion to set the command type to StoredProc in another
    posting is wrong. You are not using stored procedures.


    --
    Erland Sommarskog, SQL Server MVP, se

    Books Online for SQL Server SP3 at
    http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
    Erland Guest

  4. #4

    Default Re: can't get past ExecuteNonQuery()

    Try something like this

    Try
    {
    MyCommand.Execute...
    }
    catch (sqlexception ex)
    {
    throw new exception(ex.message);
    }

    That will give you the correct error text. I've no idea why C# gives the
    generic 'System Error' text when an sql server exception is raised but it is
    a pain in the butt.

    --
    Michael Culley


    "Trint Smith" <com> wrote in message
    news:phx.gbl... 


    Michael Guest

  5. #5

    Default Re: can't get past ExecuteNonQuery()

    thanks, i used the exception catch and found out the reasons until i got
    it right...it had to be \t delemited.


    ..Net programmer
    com

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trint Guest

Similar Threads

  1. [PHP] Need help - past deadline
    By Chris W. Parker in forum PHP Development
    Replies: 5
    Last Post: August 27th, 06:58 PM
  2. need help - past deadline
    By Jay Fitzgerald in forum PHP Development
    Replies: 0
    Last Post: August 26th, 05:30 PM
  3. please help past deadline
    By Jay Fitzgerald in forum PHP Development
    Replies: 0
    Last Post: August 26th, 05:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139