Click here to Skip to main content
15,922,155 members
Home / Discussions / Database
   

Database

 
QuestionSelect satatment Pin
wmostafaw23-Dec-06 21:31
wmostafaw23-Dec-06 21:31 
AnswerRe: Select satatment Pin
rp_suman23-Dec-06 22:53
rp_suman23-Dec-06 22:53 
AnswerRe: Select satatment Pin
Cristian Amarie25-Dec-06 22:42
Cristian Amarie25-Dec-06 22:42 
AnswerRe: Select satatment Pin
albCode26-Dec-06 1:32
albCode26-Dec-06 1:32 
QuestionHow to fill null value for a column in Oracle Pin
NK723-Dec-06 9:35
NK723-Dec-06 9:35 
AnswerRe: How to fill null value for a column in Oracle Pin
Chris Meech24-Dec-06 12:08
Chris Meech24-Dec-06 12:08 
QuestionBuild Errors on SQL Statement Pin
Swisher2422-Dec-06 8:40
Swisher2422-Dec-06 8:40 
AnswerRe: Build Errors on SQL Statement Pin
Colin Angus Mackay22-Dec-06 10:14
Colin Angus Mackay22-Dec-06 10:14 
Second attempt at this as my connection broke the first time round and IE lost the post.

Swisher24 wrote:
"oledbadapter.InsertCommand(Insert Into table1 from )"

error(s):
(249): Comma, ')', or a valid expression continuation expected.
(249): Property access must assign to the property or use its value.


Okay. The OleDbDataAdapter class doesn't have a method called InsertCommand (see the class reference on MSDN[^]). It does, however, have a property called InsertCommand so your code should read something like this:
oledbadapter.InsertCommand = someSqlString


Swisher24 wrote:
I'm having problems figuring out what to put after the "from" statement


Okay, this second part is that you are using an INSERT command. You get data "from" a table, you put data "into" a table. You have already specified which table you are putting data "into". See the INSERT Command reference[^] on MSDN.

Your command needs to be something along the lines of:
INSERT INTO Table1(Column1, Column2, Column3) VALUES ('value1', 'value2', 'value3')

So, you need to specify the columns that the data will be going into and the values of the data.

I've not used Data Adapters much (they don't fit most of the applications I've written) so I'm going on 3 year old knowledge that you typically specify the values as a series of parameters. If your database is SQL Server the parameter name is in the format @paramName, if you are using Access the parameters are a simple ? placeholder (so remember that the order of the columns must match the order of the columns in the DataTable being passed into the adapter)

Does this help?


Upcoming Scottish Developers events:
* Glasgow: Tell us what you want to see in 2007


My: Website | Blog | Photos

GeneralRe: Build Errors on SQL Statement Pin
Swisher2427-Dec-06 5:50
Swisher2427-Dec-06 5:50 
QuestionScript/tool to update schema of my database when the latest_schema script is provided Pin
PrashantJ22-Dec-06 5:36
PrashantJ22-Dec-06 5:36 
QuestionHow codeproject stores articles ? Pin
devboycpp22-Dec-06 3:59
devboycpp22-Dec-06 3:59 
QuestionSql Statement not pulling any results Pin
Almerica22-Dec-06 1:00
Almerica22-Dec-06 1:00 
AnswerRe: Sql Statement not pulling any results Pin
Pete O'Hanlon22-Dec-06 1:43
mvePete O'Hanlon22-Dec-06 1:43 
GeneralRe: Sql Statement not pulling any results Pin
Almerica22-Dec-06 2:19
Almerica22-Dec-06 2:19 
GeneralRe: Sql Statement not pulling any results Pin
Chris Buckett22-Dec-06 4:15
Chris Buckett22-Dec-06 4:15 
GeneralRe: Sql Statement not pulling any results Pin
Almerica22-Dec-06 4:18
Almerica22-Dec-06 4:18 
QuestionIs the syntax correct??? Pin
apoorva_raje22-Dec-06 0:36
apoorva_raje22-Dec-06 0:36 
AnswerRe: Is the syntax correct??? Pin
Pete O'Hanlon22-Dec-06 0:43
mvePete O'Hanlon22-Dec-06 0:43 
QuestionHow to debug a storeprocedure in sql server 2000 and 2005? Pin
irkahc22-Dec-06 0:02
irkahc22-Dec-06 0:02 
AnswerRe: How to debug a storeprocedure in sql server 2000 and 2005? Pin
Pete O'Hanlon22-Dec-06 0:44
mvePete O'Hanlon22-Dec-06 0:44 
AnswerRe: How to debug a storeprocedure in sql server 2000 and 2005? Pin
PrashantJ22-Dec-06 9:08
PrashantJ22-Dec-06 9:08 
QuestionSQL Pin
Bravoone_200621-Dec-06 23:02
Bravoone_200621-Dec-06 23:02 
AnswerRe: SQL Pin
Christian Graus21-Dec-06 23:26
protectorChristian Graus21-Dec-06 23:26 
AnswerRe: SQL Pin
Pete O'Hanlon21-Dec-06 23:28
mvePete O'Hanlon21-Dec-06 23:28 
QuestionRe: SQL Pin
Bravoone_200621-Dec-06 23:34
Bravoone_200621-Dec-06 23:34 

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.