Click here to Skip to main content
16,004,944 members
Home / Discussions / C#
   

C#

 
GeneralRe: IE DOM in C# Pin
Dave Kreskowiak29-Mar-04 2:11
mveDave Kreskowiak29-Mar-04 2:11 
GeneralRe: IE DOM in C# Pin
Heath Stewart29-Mar-04 4:20
protectorHeath Stewart29-Mar-04 4:20 
GeneralRe: IE DOM in C# Pin
Dave Kreskowiak30-Mar-04 1:49
mveDave Kreskowiak30-Mar-04 1:49 
QuestionHow to change URL of a WebService? Pin
User-37793628-Mar-04 23:44
User-37793628-Mar-04 23:44 
AnswerRe: How to change URL of a WebService? Pin
jillellamudi29-Mar-04 0:23
jillellamudi29-Mar-04 0:23 
AnswerRe: How to change URL of a WebService? Pin
Heath Stewart29-Mar-04 4:08
protectorHeath Stewart29-Mar-04 4:08 
GeneralRe: How to change URL of a WebService? Pin
User-37793630-Mar-04 4:42
User-37793630-Mar-04 4:42 
Generalopen DataReader associated with this Connection which must be closed first Pin
dabuskol28-Mar-04 23:09
dabuskol28-Mar-04 23:09 
I tried to insert data into SQL server database using the following code. All data that I received from all my connections (10 socket). It runs for sometime and I was able to insert some data then suddenly in the middle of the process I encountered
System.InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean executing)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at ossrop.Class1.SaveToSQLDB(String strFile, String strOpt) in d:\ossrop\class1.cs:line 560


I declare my DBConnect as modular and with CONNECTION POOLING.

//DBConnect = new SqlConnection("Pooling=true;server=OSSSQL01;database=nfmse;uid=alarmadmin;pwd=alarmadm1n;Min Pool Size=3;Max Pool Size=100;");
DBConnect.Open();
Processdata()
{
iRx = theSockId.thisSocket.EndReceive (asyn);
char[] chars = new char[iRx]; // + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
StringBuilder szData = new StringBuilder();
szData.Append(chars);
SaveTOSQL();
}

void SaveTOSQL()
{
string strInsert = "insert into rop values ('" + strjv.Trim() + "','" + strdate.Trim() + "','" + strclass.Trim() + "','" + strFile + "','" + strFile + "')" ;

DBCommand = new SqlCommand(strInsert,DBConnect);
DBCommand.ExecuteNonQuery();
}


PS : I don't close the connection nor the command becuase this is a 24 hour process.

Thanks in advance.
/dabsukol
GeneralRe: open DataReader associated with this Connection which must be closed first Pin
Colin Angus Mackay28-Mar-04 23:44
Colin Angus Mackay28-Mar-04 23:44 
GeneralRe: open DataReader associated with this Connection which must be closed first Pin
dabuskol29-Mar-04 1:35
dabuskol29-Mar-04 1:35 
GeneralRe: open DataReader associated with this Connection which must be closed first Pin
Colin Angus Mackay29-Mar-04 2:00
Colin Angus Mackay29-Mar-04 2:00 
GeneralBorderless CheckBox control Pin
Andy H28-Mar-04 22:16
Andy H28-Mar-04 22:16 
GeneralRe: Borderless CheckBox control Pin
jillellamudi29-Mar-04 1:00
jillellamudi29-Mar-04 1:00 
GeneralNumeric Pin
quocbao28-Mar-04 21:57
quocbao28-Mar-04 21:57 
GeneralRe: Numeric Pin
Colin Angus Mackay28-Mar-04 22:16
Colin Angus Mackay28-Mar-04 22:16 
GeneralRe: Numeric Pin
bertcox28-Mar-04 22:45
bertcox28-Mar-04 22:45 
GeneralRe: Validating data during row changes Pin
Mazdak28-Mar-04 21:52
Mazdak28-Mar-04 21:52 
Generalhooking keyboard and mouse messages Pin
Saleh Alshadheli28-Mar-04 21:46
Saleh Alshadheli28-Mar-04 21:46 
GeneralRe: hooking keyboard and mouse messages Pin
Mazdak28-Mar-04 21:50
Mazdak28-Mar-04 21:50 
GeneralRe: hooking keyboard and mouse messages Pin
oOomen28-Mar-04 22:08
oOomen28-Mar-04 22:08 
GeneralRe: hooking keyboard and mouse messages Pin
Heath Stewart29-Mar-04 4:13
protectorHeath Stewart29-Mar-04 4:13 
Questionscrolling listView ?? Pin
azusakt28-Mar-04 21:21
azusakt28-Mar-04 21:21 
AnswerRe: scrolling listView ?? Pin
Heath Stewart29-Mar-04 3:45
protectorHeath Stewart29-Mar-04 3:45 
GeneralRe: scrolling listView ?? Pin
azusakt29-Mar-04 15:05
azusakt29-Mar-04 15:05 
GeneralRe: scrolling listView ?? Pin
Heath Stewart29-Mar-04 17:20
protectorHeath Stewart29-Mar-04 17:20 

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.