program
-
Hi all I am writting a C# program that reads lines from a file. And then store each line in one record in more than one field. But at the middle of the proccessing a message said that "v\cant open more tables" here is the pic: http://www.javadevs.com/problem.bmp[^] copy the link and paste it in the browser... And here is my code: for (int i = 1; i<= Int32.Parse(numNumber.Value.ToString().Trim()); i++ ) { string cha = answers.Substring(i-1,1); string anCommand = "UPDATE information SET " + i + "='" + cha + "' WHERE id = '" + id+ "';"; try { com = new OdbcCommand(anCommand, dbConn); com.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show( anCommand + "\r\nInserting answers\r\n" + ex.ToString()); stsGrade.Text = "Error!..."; return; } finally { } } It worked for the first 3 lines, but in the fourth line the problem appeared!! All the lines has the same structure. I am using MS Access database. What is the problem?
-
Hi all I am writting a C# program that reads lines from a file. And then store each line in one record in more than one field. But at the middle of the proccessing a message said that "v\cant open more tables" here is the pic: http://www.javadevs.com/problem.bmp[^] copy the link and paste it in the browser... And here is my code: for (int i = 1; i<= Int32.Parse(numNumber.Value.ToString().Trim()); i++ ) { string cha = answers.Substring(i-1,1); string anCommand = "UPDATE information SET " + i + "='" + cha + "' WHERE id = '" + id+ "';"; try { com = new OdbcCommand(anCommand, dbConn); com.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show( anCommand + "\r\nInserting answers\r\n" + ex.ToString()); stsGrade.Text = "Error!..."; return; } finally { } } It worked for the first 3 lines, but in the fourth line the problem appeared!! All the lines has the same structure. I am using MS Access database. What is the problem?
Perhaps calling
Dispose
on yourOdbcCommand
object afterExecuteNonQuery()
will help... mav -
Hi all I am writting a C# program that reads lines from a file. And then store each line in one record in more than one field. But at the middle of the proccessing a message said that "v\cant open more tables" here is the pic: http://www.javadevs.com/problem.bmp[^] copy the link and paste it in the browser... And here is my code: for (int i = 1; i<= Int32.Parse(numNumber.Value.ToString().Trim()); i++ ) { string cha = answers.Substring(i-1,1); string anCommand = "UPDATE information SET " + i + "='" + cha + "' WHERE id = '" + id+ "';"; try { com = new OdbcCommand(anCommand, dbConn); com.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show( anCommand + "\r\nInserting answers\r\n" + ex.ToString()); stsGrade.Text = "Error!..."; return; } finally { } } It worked for the first 3 lines, but in the fourth line the problem appeared!! All the lines has the same structure. I am using MS Access database. What is the problem?
-
Perhaps calling
Dispose
on yourOdbcCommand
object afterExecuteNonQuery()
will help... mav