I am getting errors when I try to insert data into my database. I dont have any problems viewing the database. I think it is a problem with my insert statement: oleDbInsertCommand1.CommandText="INSERT INTO UserTable(Username,Password) VALUES('@NewUserTextBox.Text','@NewPasswordTextBox.Text')"; oleDbInsertCommand1.ExecuteNonQuery(); I have even tried it without the @ and other ways. This is the error I get below. System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
gmeii
Posts
-
oleDb Insert problem -
Repaint form using Invalidate()I need to know how to re-draw graphics on my forms when the forms are minimized or lose focus. I know there are an Update() and Invalidate() method but when I use them they don't work. I need to know where to put them actually. I already know that the OnPaint() method is called when the form loses focus and graphics need to be drawn. The reason i don't want to go that route is because I am using a button control that when pressed, there are counters that will change the coordinates of the graphic shape. This means I would have to save the current state or coordinates after each time the button is pressed and it would be a hassle to pass all of this to the OnPaint() method, even though it could be done. I just need a simple way to redraw my graphics in the forms.
-
Flash Splash ScreenI have a program that includes 2 splash screens. They both load correctly but the one that has a flash movie in it will just load and not play the movie. I think it is because I am using a Thread.Sleep(), that will just load the form but not execute any functions. If I load the flash form without threading the movie will play, so I know it is not an playback issue. This is a sample of the code in the Main() function. LogoSplash logo=new LogoSplash(); //This works good logo.Show(); Application.DoEvents(); Thread.Sleep(5000); logo.Close(); FlashSplash flash=new SplashScreen(); //This is where i have issues flash.Show(); Application.DoEvents(); Thread.Sleep(10000); //will execute, but not play movie flash.Close(); Application.Run(new ParentForm()); I just want the flash splash form to load and play for 10 seconds, terminate and then load the main form. If there is another route please, can anyone lead me in that direction.
-
Text alignmentI have a richTextBox control that I load text files into. What is the best way to format and align the text loaded. Also, which control is best to use for this purpose, textBox or richTextBox.
-
XML node readingI have an xml file that i'm outputing to a textbox. I have a button that is supposed to go to the next node ach time i click it. I know how to output a whole xml file but, i just want to output each node's content with the click of the button.
-
Highlight TextDoes anyone know how to highlight a row of text in a richTextBox control.