Click here to Skip to main content
15,889,176 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading and storing application settings in an object at startup Pin
Gerry Schmitz8-Apr-15 10:49
mveGerry Schmitz8-Apr-15 10:49 
AnswerRe: Reading and storing application settings in an object at startup Pin
Nathan Minier8-Apr-15 2:37
professionalNathan Minier8-Apr-15 2:37 
QuestionPerformanceCounter RawValue is not changed\modified Pin
dushkin6-Apr-15 6:05
dushkin6-Apr-15 6:05 
QuestionTextbox for numbers C# Pin
Member 114516056-Apr-15 5:06
Member 114516056-Apr-15 5:06 
AnswerRe: Textbox for numbers C# Pin
PIEBALDconsult6-Apr-15 5:09
mvePIEBALDconsult6-Apr-15 5:09 
GeneralRe: Textbox for numbers C# Pin
Member 1145160512-Apr-15 9:23
Member 1145160512-Apr-15 9:23 
AnswerRe: Textbox for numbers C# Pin
Ravi Bhavnani6-Apr-15 6:05
professionalRavi Bhavnani6-Apr-15 6:05 
QuestionQuery error: no such column Pin
DPaul19946-Apr-15 4:17
DPaul19946-Apr-15 4:17 
I have a code that selects from table only rows selected by a query using WHERE clause. But, I receive:
C#
no such column : rowbegin

But in my table I have that column which value is '1' and is int type. Code for selection is this:
C#
using (Conexiune.getConnection()) // Conexiunea
            {
                string select = "SELECT * FROM questions WHERE id = rowbegin LIMIT 1";
                SQLiteCommand cmd = new SQLiteCommand(select, Conexiune.getConnection());
                cmd.CommandType = CommandType.Text;
                SQLiteDataReader rdra = cmd.ExecuteReader();
                try
                {
                    while (rdra.Read())
                    {
                        textBox1.Text = rdra["question"].ToString();
                        textBox2.Text = rdra["answer1"].ToString();
                        textBox3.Text = rdra["answer2"].ToString();
                        textBox4.Text = rdra["answer3"].ToString();
                        r1 = (int)rdra["option1"];
                        r2 = (int)rdra["option2"];
                        r3 = (int)rdra["option3"];
                        corect = (int)rdra["indexyes"];
                        incorect = (int)rdra["indexno"];
                        currentrow = Convert.ToInt32(rdra["id"]);
                        SimulatorManager.Intrebare = textBox1.Text;
                        label11.Text = currentrow.ToString();
                        label4.Text = corect.ToString();
                        label6.Text = incorect.ToString();
                    }
                }
                catch (InvalidOperationException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

Why it doesn't recognise my column? If I replace rowbegin in query with a value, it works.
AnswerRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 4:50
mveDave Kreskowiak6-Apr-15 4:50 
GeneralRe: Query error: no such column Pin
DPaul19946-Apr-15 5:40
DPaul19946-Apr-15 5:40 
GeneralRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 6:26
mveDave Kreskowiak6-Apr-15 6:26 
GeneralRe: Query error: no such column Pin
DPaul19946-Apr-15 6:41
DPaul19946-Apr-15 6:41 
GeneralRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 7:35
mveDave Kreskowiak6-Apr-15 7:35 
GeneralRe: Query error: no such column Pin
DPaul19946-Apr-15 8:07
DPaul19946-Apr-15 8:07 
GeneralRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 8:22
mveDave Kreskowiak6-Apr-15 8:22 
GeneralRe: Query error: no such column Pin
DPaul19946-Apr-15 8:26
DPaul19946-Apr-15 8:26 
QuestionHow to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Tridip Bhattacharjee6-Apr-15 1:09
professionalTridip Bhattacharjee6-Apr-15 1:09 
AnswerRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Eddy Vluggen6-Apr-15 2:42
professionalEddy Vluggen6-Apr-15 2:42 
AnswerRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Dr Gadgit6-Apr-15 4:03
Dr Gadgit6-Apr-15 4:03 
AnswerRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Dave Kreskowiak6-Apr-15 4:43
mveDave Kreskowiak6-Apr-15 4:43 
GeneralRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Tridip Bhattacharjee6-Apr-15 21:27
professionalTridip Bhattacharjee6-Apr-15 21:27 
SuggestionRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Richard Deeming7-Apr-15 2:07
mveRichard Deeming7-Apr-15 2:07 
Questionsplit string Pin
Member 103707115-Apr-15 12:53
professionalMember 103707115-Apr-15 12:53 
AnswerRe: split string Pin
Richard Andrew x645-Apr-15 13:07
professionalRichard Andrew x645-Apr-15 13:07 
GeneralصهفاRe: split string Pin
Member 103707115-Apr-15 13:20
professionalMember 103707115-Apr-15 13: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.