c# and sql-server express 2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Pollard

    c# and sql-server express 2005

    Hi All,
    I'm pretty new to using these technologies so bear with me. I have created
    a c# app which communicates with sql-server express 2005. When I run an
    insert on a table via the SqlCommand class nothing seems to happen! No
    errors are apparent either. If I check the table contents in the IDE I see
    that they have not been updated.

    However...

    If I run the app outside of the development environment the data seems to
    get inserted properly and can be seen within the application between
    instances. Checking the table contents within the IDE shows that they have
    not changed?! Sometimes the data seems to disappear from the tables, though
    I haven't figured out how or why yet.

    When running outside of the IDE I see the same data that was set-up on the
    tables in the IDE so it must be the same Db, but for some reason inserts
    don't seem to show up.

    I'm guessing that I'm lacking some kind of understanding as to the databases
    instancing? but I'm not sure. Any help would be most appreciated.

    Thanks
    RobP
    'There are only 10 types of people in this world - Those that understand
    binary and those that don't'


  • MMA

    #2
    RE: c# and sql-server express 2005

    Hi Rob,
    Seems quite perculiar, but the next you try debugging your app within VS (I
    am assuming you are using VS) try refreshing the tables that you are
    inserting into to see if the data did get populated. The only other reason I
    can think of that you are not able to see the data when in debug mode could
    be because the transaction has not commited yet. So you may want to look into
    commiting your trans within the code. Also throw a try catch block where you
    are making the insertion and see if it lead you any where.

    Hope this helps.

    Thanks


    "Rob Pollard" wrote:
    Hi All,
    I'm pretty new to using these technologies so bear with me. I have created
    a c# app which communicates with sql-server express 2005. When I run an
    insert on a table via the SqlCommand class nothing seems to happen! No
    errors are apparent either. If I check the table contents in the IDE I see
    that they have not been updated.
    >
    However...
    >
    If I run the app outside of the development environment the data seems to
    get inserted properly and can be seen within the application between
    instances. Checking the table contents within the IDE shows that they have
    not changed?! Sometimes the data seems to disappear from the tables, though
    I haven't figured out how or why yet.
    >
    When running outside of the IDE I see the same data that was set-up on the
    tables in the IDE so it must be the same Db, but for some reason inserts
    don't seem to show up.
    >
    I'm guessing that I'm lacking some kind of understanding as to the databases
    instancing? but I'm not sure. Any help would be most appreciated.
    >
    Thanks
    RobP
    'There are only 10 types of people in this world - Those that understand
    binary and those that don't'
    >
    >
    >

    Comment

    • Rob Pollard

      #3
      Re: c# and sql-server express 2005

      Thanks for the reply. I tried a Try-Catch (No errors thrown) and I
      introduced transactional handling and neither seems to make any difference.
      Its almost like the tables in VS are some sort of base template that cannot
      be altered but are used for creating other 'instances' of the Db. I know
      that SQL-Server Express is many orders of magnitude more robust than the
      original Access style DB's and I'm guessing that along with this robustness
      comes an administrative overhead which due to my lack of familiarity might
      be producing the problems that I am seeing.

      RobP
      'There are only 10 types of people in this world - Those that understand
      binary and those that don't'


      "MMA" <MMA@discussion s.microsoft.com wrote in message
      news:B5D9C172-C89A-4985-9C36-B18FCA6F7F5A@mi crosoft.com...
      Hi Rob,
      Seems quite perculiar, but the next you try debugging your app within VS
      (I
      am assuming you are using VS) try refreshing the tables that you are
      inserting into to see if the data did get populated. The only other reason
      I
      can think of that you are not able to see the data when in debug mode
      could
      be because the transaction has not commited yet. So you may want to look
      into
      commiting your trans within the code. Also throw a try catch block where
      you
      are making the insertion and see if it lead you any where.
      >
      Hope this helps.
      >
      Thanks
      >
      >
      "Rob Pollard" wrote:
      >
      >Hi All,
      > I'm pretty new to using these technologies so bear with me. I have
      >created
      >a c# app which communicates with sql-server express 2005. When I run an
      >insert on a table via the SqlCommand class nothing seems to happen! No
      >errors are apparent either. If I check the table contents in the IDE I
      >see
      >that they have not been updated.
      >>
      >However...
      >>
      >If I run the app outside of the development environment the data seems to
      >get inserted properly and can be seen within the application between
      >instances. Checking the table contents within the IDE shows that they
      >have
      >not changed?! Sometimes the data seems to disappear from the tables,
      >though
      >I haven't figured out how or why yet.
      >>
      >When running outside of the IDE I see the same data that was set-up on
      >the
      >tables in the IDE so it must be the same Db, but for some reason inserts
      >don't seem to show up.
      >>
      >I'm guessing that I'm lacking some kind of understanding as to the
      >databases
      >instancing? but I'm not sure. Any help would be most appreciated.
      >>
      >Thanks
      >RobP
      >'There are only 10 types of people in this world - Those that understand
      >binary and those that don't'
      >>
      >>
      >>

      Comment

      Working...