Click here to Skip to main content
15,890,670 members
Home / Discussions / C#
   

C#

 
AnswerRe: Send Object By Value? Pin
Vikram A Punathambekar16-May-08 0:13
Vikram A Punathambekar16-May-08 0:13 
QuestionSHGetFileInfo does not work for large icons Pin
nilam247715-May-08 23:54
nilam247715-May-08 23:54 
AnswerRe: SHGetFileInfo does not work for large icons Pin
DaveyM6916-May-08 3:16
professionalDaveyM6916-May-08 3:16 
AnswerRe: SHGetFileInfo does not work for large icons Pin
DaveyM6916-May-08 3:25
professionalDaveyM6916-May-08 3:25 
QuestionAbout grid checkBox Pin
Prabhat00315-May-08 23:51
Prabhat00315-May-08 23:51 
AnswerRe: About grid checkBox Pin
stancrm16-May-08 0:52
stancrm16-May-08 0:52 
GeneralRe: About grid checkBox Pin
Prabhat00316-May-08 1:03
Prabhat00316-May-08 1:03 
QuestionC# MS Sql Express: share connection between threads? Pin
Michiel15-May-08 23:46
Michiel15-May-08 23:46 
Hi all,

I'm having a hard time dealing with some errors while using multiple threads to access a local MS SQL Express database.

I will try to explain what my programm does:

1.
There is a socket connection between this program(A) and an other program(B). Depending on the information received from B this program will query the database and update some values.

2.
There is also a thread running who checks the database, looks for updates, and sends them to via the socket to programB.

3.
Then there is also a button on the GUI who send custom commands to programmB. ProgramB will respond to that by sending data back to my program. (like section 1)


Depending on the amount of database access required I receive some errors like:

"System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed"

or

"There is already an open DataReader associated with this Command which must be closed first"

or

"The connection was not closed. The connection's current state is open"

If have been playing for a while and changing the code, but nothing helped. I guess it has something to do whith to different threads want to acces the same connection at the same time. Can anyone help me on this?

Thanks in advance!

Michiel
AnswerRe: C# MS Sql Express: share connection between threads? Pin
originSH16-May-08 0:34
originSH16-May-08 0:34 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
Michiel16-May-08 1:20
Michiel16-May-08 1:20 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
originSH16-May-08 1:28
originSH16-May-08 1:28 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
Michiel16-May-08 3:48
Michiel16-May-08 3:48 
AnswerRe: C# MS Sql Express: share connection between threads? Pin
Peter Josefsson Sweden16-May-08 13:32
Peter Josefsson Sweden16-May-08 13:32 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
originSH18-May-08 22:10
originSH18-May-08 22:10 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
Peter Josefsson Sweden18-May-08 23:28
Peter Josefsson Sweden18-May-08 23:28 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
originSH18-May-08 23:56
originSH18-May-08 23:56 
GeneralRe: C# MS Sql Express: share connection between threads? [modified] Pin
Michiel20-May-08 23:44
Michiel20-May-08 23:44 
GeneralRe: C# MS Sql Express: share connection between threads? [modified] Pin
Peter Josefsson Sweden21-May-08 2:58
Peter Josefsson Sweden21-May-08 2:58 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
Michiel21-May-08 3:33
Michiel21-May-08 3:33 
GeneralRe: C# MS Sql Express: share connection between threads? Pin
Peter Josefsson Sweden21-May-08 3:43
Peter Josefsson Sweden21-May-08 3:43 
AnswerRe: C# MS Sql Express: share connection between threads? Pin
Peter Josefsson Sweden16-May-08 13:52
Peter Josefsson Sweden16-May-08 13:52 
AnswerRe: C# MS Sql Express: share connection between threads? Pin
Peter Josefsson Sweden16-May-08 14:28
Peter Josefsson Sweden16-May-08 14:28 
QuestionDrawEllipse and FillEllipse methods Pin
NarVish15-May-08 23:11
NarVish15-May-08 23:11 
AnswerRe: DrawEllipse and FillEllipse methods Pin
Christian Graus15-May-08 23:28
protectorChristian Graus15-May-08 23:28 
AnswerRe: DrawEllipse and FillEllipse methods Pin
John_Adams15-May-08 23:32
John_Adams15-May-08 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.