murfinp
asked on
sqlite c# datareader
Hi
I have the following code
tickDB = new SQLiteConnection("Data Source =" + @txbData.Text);
tickDB.Open();
tickCommand = new SQLiteCommand();
tickCommand.Connection = tickDB;
tickCommand.CommandText = "SELECT DATE,TIME,LAST,BID,ASK FROM TICKS;";
tickReader = tickCommand.ExecuteReader( );
while (tickReader.Read())
{
string aaa = tickReader.GetString(0);
string bbb = tickReader.GetString(1);
}
it seems to be reading fine ... loops through fine but in the debugger when i try and look at string aaa or string bbb it says not in the current conext? Am I going crazy?
Thanks
I have the following code
tickDB = new SQLiteConnection("Data Source =" + @txbData.Text);
tickDB.Open();
tickCommand = new SQLiteCommand();
tickCommand.Connection = tickDB;
tickCommand.CommandText = "SELECT DATE,TIME,LAST,BID,ASK FROM TICKS;";
tickReader = tickCommand.ExecuteReader(
while (tickReader.Read())
{
string aaa = tickReader.GetString(0);
string bbb = tickReader.GetString(1);
}
it seems to be reading fine ... loops through fine but in the debugger when i try and look at string aaa or string bbb it says not in the current conext? Am I going crazy?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you able to prompt the values?
If this is a console application you could try a Console.WriteLine(aaa); to see if it works correctly.
If so, you "only" have a VS debugger problem.
If this is a console application you could try a Console.WriteLine(aaa); to see if it works correctly.
If so, you "only" have a VS debugger problem.
ASKER
ok thanks ... i'll have a play ... a bit of a weird one ...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The using() blocks will automatically dispose the object in () when execution leaves the scope of the enclosing brackets ({}). even if there is an exception
ASKER
Thanks guys ... the real problem was I was running in the IDE in release mode! doh!
ASKER
I actually also tried that and had the same problem????