Jump to content

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

- - - - -

  • Please log in to reply
3 replies to this topic

#1
gazzel

gazzel

    Newbie

  • Members
  • Pip
  • 3 posts
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)
Attached File  6718082809_3cb4966a08_b.jpg   204.97K   51 downloads
***************************************
(using VISUAL STUDIO database)
Attached File  6718102213_f25720f617_b.jpg   315.23K   26 downloads
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.


#2
lespauled

lespauled

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 231 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash
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.

#3
gazzel

gazzel

    Newbie

  • Members
  • Pip
  • 3 posts
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.? ])

#4
gazzel

gazzel

    Newbie

  • Members
  • Pip
  • 3 posts
ERROR FIXed. just use separate connection for each datareader.:w00t:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users