Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

C# problem converting database (visual studio 2008 database TO MSSQL 2005)

visual studio 2008 mssql

  • Please log in to reply
3 replies to this topic

#1 gazzel


    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 17 January 2012 - 07:47 PM

Good day programmers of "Codecall"
i wish you can help me with my problem;)
this is not a web page C#..
it is a simple C# and database

here's my problem:
Inserting and selecting in other forms are working fine
but when it comes with the listview error appears and cant "LOAD" branches

(using VISUAL STUDIO database)
i change all SqlCeDataReader to Sqldatareader in the form
and i also change the connection of this...



thanks in advance
more powers for codecall

Attached Files

Edited by gazzel, 17 January 2012 - 09:15 PM.

  • 0

#2 lespauled


    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 18 January 2012 - 08:42 AM

The first thing in noticed was that you have all the database code in the UI. Not good. Separate it out to a data tier. Keep only UI code in the UI.

Around line 1674, you are closing the reader, and the connection, inside the read's while. That will throw an exception.
  • 0

#3 gazzel


    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 18 January 2012 - 07:42 PM

thanks for replying sir lespauled,
But still same error...
can you give me advice? do i need to pull the database to a new one(MSSQL)?
or just stay to the Old database(Visual studio)(HOW can i share my database to other user?[connct.? ])
  • 0

#4 gazzel


    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 18 January 2012 - 11:20 PM

ERROR FIXed. just use separate connection for each datareader.:w00t:
  • 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download