Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

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

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 MSSQL DATABASE)
6718082809_3cb4966a08_b.jpg
***************************************
(using VISUAL STUDIO database)
6718102213_f25720f617_b.jpg
i change all SqlCeDataReader to Sqldatareader in the form
and i also change the connection of this...

[ATTACH]4501[/ATTACH]

[ATTACH]4502[/ATTACH]

thanks in advance
GODBLESS
more powers for codecall

Attached Files


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

  • 0

#2 lespauled

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

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

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





Also tagged with one or more of these keywords: visual studio 2008, mssql

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