Click here to Skip to main content
15,917,793 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
V.16-Jan-18 22:06
professionalV.16-Jan-18 22:06 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Member 1030297117-Jan-18 3:00
Member 1030297117-Jan-18 3:00 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
F-ES Sitecore17-Jan-18 4:05
professionalF-ES Sitecore17-Jan-18 4:05 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Pete O'Hanlon17-Jan-18 4:41
mvePete O'Hanlon17-Jan-18 4:41 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
V.18-Jan-18 3:25
professionalV.18-Jan-18 3:25 
QuestionException raised at wpf designer level Pin
abboudi_ammar16-Jan-18 7:35
abboudi_ammar16-Jan-18 7:35 
QuestionHow to convert a query to lambda based Pin
Mou_kol16-Jan-18 1:43
Mou_kol16-Jan-18 1:43 
AnswerRe: How to convert a query to lambda based Pin
OriginalGriff16-Jan-18 1:52
mveOriginalGriff16-Jan-18 1:52 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 3:50
Mou_kol16-Jan-18 3:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 0:26
Mou_kol24-Jan-18 0:26 
GeneralRe: How to convert a query to lambda based Pin
OriginalGriff24-Jan-18 0:44
mveOriginalGriff24-Jan-18 0:44 
AnswerRe: How to convert a query to lambda based Pin
Richard Deeming16-Jan-18 3:03
mveRichard Deeming16-Jan-18 3:03 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 3:50
Mou_kol16-Jan-18 3:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 0:35
Mou_kol24-Jan-18 0:35 
Questioncontour plot in visual studio Pin
Member 1362407415-Jan-18 6:27
Member 1362407415-Jan-18 6:27 
AnswerRe: contour plot in visual studio Pin
Richard MacCutchan15-Jan-18 7:15
mveRichard MacCutchan15-Jan-18 7:15 
QuestionI got the error that: Not all code paths return a value Pin
irisemars15-Jan-18 2:15
irisemars15-Jan-18 2:15 
AnswerRe: I got the error that: Not all code paths return a value Pin
Jochen Arndt15-Jan-18 2:22
professionalJochen Arndt15-Jan-18 2:22 
AnswerRe: I got the error that: Not all code paths return a value Pin
OriginalGriff15-Jan-18 4:10
mveOriginalGriff15-Jan-18 4:10 
QuestionSpeech recognition: Unable to LoadGrammar and no installed recognizer Pin
Mc_Topaz13-Jan-18 3:35
Mc_Topaz13-Jan-18 3:35 
QuestionSelect data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 2:51
Member 1346617612-Jan-18 2:51 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard MacCutchan12-Jan-18 3:11
mveRichard MacCutchan12-Jan-18 3:11 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 3:13
mveRichard Deeming12-Jan-18 3:13 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 3:36
Member 1346617612-Jan-18 3:36 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 3:45
mveRichard Deeming12-Jan-18 3:45 
Member 13466176 wrote:
doesnt the CommandBuilder automatically convert the SELECT statement into an Insert statement when I call da.Update(dt)?

IIRC, it should do. But the error you're getting suggests that's not working for the OracleCommandBuilder for some reason.

Member 13466176 wrote:
Anyways, could you tell me how to bind the columns of the dataset dt to a parameter like you showed?

It's a while since I used a DataAdapter to modify data, but something like this should work:
da.InsertCommand = new OracleCommand("INSERT INTO Tab2 (A, B) VALUES (:A, :B)", connOracle);

var p = da.InsertCommand.CreateParameter();
p.ParameterName = "A";
p.SourceColumn = "A";
p.SourceVersion = DataRowVersion.Current;
da.InsertCommand.Parameters.Add(p);

p = da.InsertCommand.CreateParameter();
p.ParameterName = "B";
p.SourceColumn = "B";
p.SourceVersion = DataRowVersion.Current;
da.InsertCommand.Parameters.Add(p);

da.Update(dt);




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


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.